刘光辉
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
44
45
46
47
48
49
50
51
52
53
54
55
package jnpf.elnMapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.elnEntity.formula.ElnTemplateFormulaBindingEntity;
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 ElnTemplateFormulaBindingMapper
        extends BaseMapper<ElnTemplateFormulaBindingEntity> {
 
    @Insert("INSERT INTO eln_template_formula_binding (muban_id, gongshi_dingyi_id, "
            + "gongshi_banben_id, canshu_yingshe, jieguo_bangding_id, "
            + "bangding_zhuangtai, tuopu_xuhao, caozuo_bianma, "
            + "jieguo_suo_kuaizhao, "
            + "laiyuan_gongshi_bangding_id, daoqi_shijian, zhuangtai_yuanyin, 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.mubanId}, "
            + "#{entity.gongshiDingyiId}, #{entity.gongshiBanbenId}, "
            + "#{entity.canshuYingshe,jdbcType=OTHER,typeHandler="
            + "jnpf.elnEntity.formula.ElnTemplateFormulaBindingEntity$ParameterMappingTypeHandler}, "
            + "#{entity.jieguoBangdingId}, #{entity.bangdingZhuangtai}, "
            + "#{entity.tuopuXuhao}, #{entity.caozuoBianma}, "
            + "#{entity.jieguoSuoKuaizhao,jdbcType=OTHER,typeHandler="
            + "jnpf.elnEntity.formula.ElnTemplateFormulaBindingEntity$ControlSnapshotListTypeHandler}, "
            + "#{entity.laiyuanGongshiBangdingId}, #{entity.daoqiShijian}, "
            + "#{entity.zhuangtaiYuanyin}, #{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, muban_id, caozuo_bianma) DO NOTHING")
    int insertIfAbsent(@Param("entity") ElnTemplateFormulaBindingEntity entity);
 
    @Update("UPDATE eln_template_formula_binding SET "
            + "gongshi_dingyi_id = #{entity.gongshiDingyiId}, "
            + "gongshi_banben_id = #{entity.gongshiBanbenId}, "
            + "canshu_yingshe = #{entity.canshuYingshe,jdbcType=OTHER,typeHandler="
            + "jnpf.elnEntity.formula.ElnTemplateFormulaBindingEntity$ParameterMappingTypeHandler}, "
            + "jieguo_bangding_id = #{entity.jieguoBangdingId}, "
            + "caozuo_bianma = #{entity.caozuoBianma}, "
            + "bangding_zhuangtai = #{targetStatus}, "
            + "zhuangtai_yuanyin = #{reason}, "
            + "f_version = #{expectedVersion} + 1 "
            + "WHERE f_tenant_id = #{entity.fTenantId} "
            + "AND f_id = #{entity.id} "
            + "AND f_version = #{expectedVersion} "
            + "AND bangding_zhuangtai = #{entity.bangdingZhuangtai}")
    int updateStatus(@Param("entity") ElnTemplateFormulaBindingEntity entity,
                     @Param("expectedVersion") int expectedVersion,
                     @Param("targetStatus") String targetStatus,
                     @Param("reason") String reason);
}