TInsScopeInforMapper.xml 8.43 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
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
<?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.zehong.system.mapper.TInsScopeInforMapper">
    
    <resultMap type="TInsScopeInfor" id="TInsScopeInforResult">
        <result property="fScopeInforId"    column="f_scope_infor_id"    />
        <result property="fHazardCheckTaskId"    column="f_hazard_check_task_id"    />
        <result property="fObjectType"    column="f_object_type"    />
        <result property="fHazardCheckTableRecordId"    column="f_hazard_check_table_record_id"    />
        <result property="fSpotCheckType"    column="f_spot_check_type"    />
        <result property="fSpotCheck"    column="f_spot_check"    />
        <result property="fSpecialFlag"    column="f_special_flag"    />
        <result property="fLotCount"    column="f_lot_count"    />
        <result property="fSubobjecttypeCheckTypeDesc"    column="f_subobjecttype_check_type_desc"    />
        <result property="fDeleteFlag"    column="f_delete_flag"    />
        <result property="fRemark"    column="f_remark"    />
        <result property="fCreateTime"    column="f_create_time"    />
        <result property="fCreateBy"    column="f_create_by"    />
        <result property="fUpdateTime"    column="f_update_time"    />
        <result property="fModifyBy"    column="f_modify_by"    />
    </resultMap>

    <sql id="selectTInsScopeInforVo">
        SELECT
            scope.f_scope_infor_id,
            scope.f_hazard_check_task_id,
            scope.f_object_type,
            scope.f_hazard_check_table_record_id,
            scope.f_spot_check_type,
            scope.f_spot_check,
            scope.f_special_flag,
            scope.f_lot_count,
            scope.f_subobjecttype_check_type_desc,
            scope.f_delete_flag,
            scope.f_remark,
            scope.f_create_time,
            scope.f_create_by,
            scope.f_update_time,
            scope.f_modify_by,
            task.f_name AS fName
        FROM
            t_ins_scope_infor scope
        LEFT JOIN t_ins_task_infor task ON task.f_ins_task_infor_id = scope.f_hazard_check_task_id
    </sql>

    <select id="selectTInsScopeInforList" parameterType="TInsScopeInfor" resultMap="TInsScopeInforResult">
        <include refid="selectTInsScopeInforVo"/>
        <where>
            <if test="fName != null  and fName != ''"> and task.f_name like concat('%', #{fName}, '%')</if>
            <if test="fObjectType != null  and fObjectType != ''"> and scope.f_object_type = #{fObjectType}</if>
            <if test="fSpotCheckType != null  and fSpotCheckType != ''"> and scope.f_spot_check_type = #{fSpotCheckType}</if>
54
            <if test="fHazardCheckTaskId != null"> and scope.f_hazard_check_task_id = #{fHazardCheckTaskId}</if>
耿迪迪's avatar
耿迪迪 committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
        </where>
        ORDER BY scope.f_create_time DESC
    </select>
    
    <select id="selectTInsScopeInforById" parameterType="Long" resultMap="TInsScopeInforResult">
        <include refid="selectTInsScopeInforVo"/>
        where scope.f_scope_infor_id = #{fScopeInforId}
    </select>
        
    <insert id="insertTInsScopeInfor" parameterType="TInsScopeInfor" useGeneratedKeys="true" keyProperty="fScopeInforId">
        insert into t_ins_scope_infor
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fHazardCheckTaskId != null">f_hazard_check_task_id,</if>
            <if test="fObjectType != null and fObjectType != ''">f_object_type,</if>
            <if test="fHazardCheckTableRecordId != null">f_hazard_check_table_record_id,</if>
            <if test="fSpotCheckType != null">f_spot_check_type,</if>
            <if test="fSpotCheck != null">f_spot_check,</if>
            <if test="fSpecialFlag != null">f_special_flag,</if>
            <if test="fLotCount != null">f_lot_count,</if>
            <if test="fSubobjecttypeCheckTypeDesc != null">f_subobjecttype_check_type_desc,</if>
            <if test="fDeleteFlag != null">f_delete_flag,</if>
            <if test="fRemark != null">f_remark,</if>
            <if test="fCreateTime != null">f_create_time,</if>
            <if test="fCreateBy != null">f_create_by,</if>
            <if test="fUpdateTime != null">f_update_time,</if>
            <if test="fModifyBy != null">f_modify_by,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fHazardCheckTaskId != null">#{fHazardCheckTaskId},</if>
            <if test="fObjectType != null and fObjectType != ''">#{fObjectType},</if>
            <if test="fHazardCheckTableRecordId != null">#{fHazardCheckTableRecordId},</if>
            <if test="fSpotCheckType != null">#{fSpotCheckType},</if>
            <if test="fSpotCheck != null">#{fSpotCheck},</if>
            <if test="fSpecialFlag != null">#{fSpecialFlag},</if>
            <if test="fLotCount != null">#{fLotCount},</if>
            <if test="fSubobjecttypeCheckTypeDesc != null">#{fSubobjecttypeCheckTypeDesc},</if>
            <if test="fDeleteFlag != null">#{fDeleteFlag},</if>
            <if test="fRemark != null">#{fRemark},</if>
            <if test="fCreateTime != null">#{fCreateTime},</if>
            <if test="fCreateBy != null">#{fCreateBy},</if>
            <if test="fUpdateTime != null">#{fUpdateTime},</if>
            <if test="fModifyBy != null">#{fModifyBy},</if>
         </trim>
    </insert>

    <update id="updateTInsScopeInfor" parameterType="TInsScopeInfor">
        update t_ins_scope_infor
        <trim prefix="SET" suffixOverrides=",">
            <if test="fHazardCheckTaskId != null">f_hazard_check_task_id = #{fHazardCheckTaskId},</if>
            <if test="fObjectType != null and fObjectType != ''">f_object_type = #{fObjectType},</if>
            <if test="fHazardCheckTableRecordId != null">f_hazard_check_table_record_id = #{fHazardCheckTableRecordId},</if>
            <if test="fSpotCheckType != null">f_spot_check_type = #{fSpotCheckType},</if>
            <if test="fSpotCheck != null">f_spot_check = #{fSpotCheck},</if>
            <if test="fSpecialFlag != null">f_special_flag = #{fSpecialFlag},</if>
            <if test="fLotCount != null">f_lot_count = #{fLotCount},</if>
            <if test="fSubobjecttypeCheckTypeDesc != null">f_subobjecttype_check_type_desc = #{fSubobjecttypeCheckTypeDesc},</if>
            <if test="fDeleteFlag != null">f_delete_flag = #{fDeleteFlag},</if>
            <if test="fRemark != null">f_remark = #{fRemark},</if>
            <if test="fCreateTime != null">f_create_time = #{fCreateTime},</if>
            <if test="fCreateBy != null">f_create_by = #{fCreateBy},</if>
            <if test="fUpdateTime != null">f_update_time = #{fUpdateTime},</if>
            <if test="fModifyBy != null">f_modify_by = #{fModifyBy},</if>
        </trim>
        where f_scope_infor_id = #{fScopeInforId}
    </update>

    <delete id="deleteTInsScopeInforById" parameterType="Long">
        delete from t_ins_scope_infor where f_scope_infor_id = #{fScopeInforId}
    </delete>

    <delete id="deleteTInsScopeInforByIds" parameterType="String">
        delete from t_ins_scope_infor where f_scope_infor_id in 
        <foreach item="fScopeInforId" collection="array" open="(" separator="," close=")">
            #{fScopeInforId}
        </foreach>
    </delete>
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168


    <insert id="batchInsertTInsScopeInfor" parameterType="TInsScopeInfor" useGeneratedKeys="true" keyProperty="fScopeInforId">
        insert into t_ins_scope_infor(
            f_hazard_check_task_id,
            f_object_type,
            f_hazard_check_table_record_id,
            f_spot_check_type,
            f_spot_check,
            f_special_flag,
            f_lot_count,
            f_subobjecttype_check_type_desc,
            f_delete_flag,
            f_remark,
            f_create_time,
            f_create_by,
            f_update_time,
            f_modify_by
        )VALUES
        <foreach collection="list" separator="," item="item">
            (
                #{item.fHazardCheckTaskId},
                #{item.fObjectType},
                #{item.fHazardCheckTableRecordId},
                #{item.fSpotCheckType},
                #{item.fSpotCheck},
                #{item.fSpecialFlag},
                #{item.fLotCount},
                #{item.fSubobjecttypeCheckTypeDesc},
                #{item.fDeleteFlag},
                #{item.fRemark},
                #{item.fCreateTime},
                #{item.fCreateBy},
                #{item.fUpdateTime},
                #{item.fModifyBy}
            )
        </foreach>
    </insert>
耿迪迪's avatar
耿迪迪 committed
169
</mapper>