刘光辉
119 分钟以前 06f314545ac3514d7ce28939920866ae8188d31c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package jnpf.elnMapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.elnEntity.formula.ElnFormulaParameterSlotEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
 
@Mapper
public interface ElnFormulaParameterSlotMapper extends BaseMapper<ElnFormulaParameterSlotEntity> {
 
    @Insert("INSERT INTO eln_formula_parameter_slot (gongshi_banben_id, canshu_bianma, "
            + "canshu_mingcheng, shuju_leixing, danwei, shifou_bitian, paixu, f_id, "
            + "f_tenant_id, f_version, f_creator_user_id, f_creator_time, "
            + "f_last_modify_user_id, f_last_modify_time, f_delete_user_id, f_delete_time, "
            + "f_delete_mark) VALUES (#{entity.gongshiBanbenId}, #{entity.canshuBianma}, "
            + "#{entity.canshuMingcheng}, #{entity.shujuLeixing}, #{entity.danwei}, "
            + "#{entity.shifouBitian}, #{entity.paixu}, #{entity.id}, #{entity.fTenantId}, "
            + "#{entity.fVersion}, #{entity.fCreatorUserId}, #{entity.fCreatorTime}, "
            + "#{entity.fLastModifyUserId}, #{entity.fLastModifyTime}, "
            + "#{entity.fDeleteUserId}, #{entity.fDeleteTime}, #{entity.fDeleteMark}) "
            + "ON CONFLICT (f_tenant_id, gongshi_banben_id, canshu_bianma) DO NOTHING")
    int insertIgnoreCode(@Param("entity") ElnFormulaParameterSlotEntity entity);
 
    @Update("UPDATE eln_formula_parameter_slot SET "
            + "canshu_mingcheng = #{entity.canshuMingcheng}, "
            + "shuju_leixing = #{entity.shujuLeixing}, danwei = #{entity.danwei}, "
            + "shifou_bitian = #{entity.shifouBitian}, paixu = #{entity.paixu}, "
            + "f_last_modify_user_id = #{entity.fLastModifyUserId}, "
            + "f_last_modify_time = #{entity.fLastModifyTime}, f_version = f_version + 1 "
            + "WHERE f_tenant_id = #{entity.fTenantId} AND f_id = #{entity.id} "
            + "AND f_version = #{expectedVersion}")
    int updateMutableByTenantAndVersion(@Param("entity") ElnFormulaParameterSlotEntity entity,
                                        @Param("expectedVersion") Integer expectedVersion);
 
    @Delete("DELETE FROM eln_formula_parameter_slot "
            + "WHERE f_tenant_id = #{entity.fTenantId} AND f_id = #{entity.id} "
            + "AND f_version = #{expectedVersion}")
    int deleteByTenantAndVersion(@Param("entity") ElnFormulaParameterSlotEntity entity,
                                 @Param("expectedVersion") Integer expectedVersion);
}