郑永安
2023-06-19 c8188c0fc9edf6ea3feda5b6f11dcb014af2a89e
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
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gk.hotwork.Mapper.SafetySelfInspectionItemDeductionMapper" >
  <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SafetySelfInspectionItemDeduction" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="valid_flag" property="validFlag" jdbcType="TINYINT" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="update_by" property="updateBy" jdbcType="VARCHAR" />
 
    <result column="safety_self_inspection_item_id" property="safetySelfInspectionItemId" jdbcType="BIGINT" />
    <result column="safety_inspection_item_deduction_id" property="safetyInspectionItemDeductionId" jdbcType="BIGINT" />
    <result column="name" property="name" jdbcType="VARCHAR" />
    <result column="point" property="point" jdbcType="BIGINT" />
    <result column="remark" property="remark" jdbcType="VARCHAR" />
  </resultMap>
 
    <select id="getBySafetySelfInspectionItemId" resultMap="BaseResultMap">
      SELECT
          a.*,
          b.`name`
      FROM
          safety_self_inspection_item_deduction a
          LEFT JOIN safety_inspection_item_deduction b ON a.safety_inspection_item_deduction_id = b.id
      WHERE
          a.valid_flag = 1
          AND safety_self_inspection_item_id=#{safetySelfInspectionItemId}
    </select>
 
 
  <update id="delBySafetySelfInspectionItemId">
    update safety_self_inspection_item_deduction set
    valid_flag=0,
    update_time=#{updateTime},
    update_by=#{updateBy}
    where safety_self_inspection_item_id=#{safetySelfInspectionItemId}
  </update>
</mapper>