TLpgGasBottleFilesMapper.xml 15.9 KB
Newer Older
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
<?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.TLpgGasBottleFilesMapper">
    
    <resultMap type="TLpgGasBottleFiles" id="TLpgGasBottleFilesResult">
        <result property="fGasBottleFilesId"    column="f_gas_bottle_files_id"    />
        <result property="fRegCode"    column="f_reg_code"    />
        <result property="fEquNo"    column="f_equ_no"    />
        <result property="fEquType"    column="f_equ_type"    />
        <result property="fMedium"    column="f_medium"    />
        <result property="fMakeDate"    column="f_make_date"    />
        <result property="fMakeInfo"    column="f_make_info"    />
        <result property="fSelfId"    column="f_self_id"    />
        <result property="fPressure"    column="f_pressure"    />
        <result property="fVolume"    column="f_volume"    />
        <result property="fAppId"    column="f_app_id"    />
        <result property="fQRcode"    column="f_q_rcode"    />
        <result property="fBuildUser"    column="f_build_user"    />
        <result property="fOptName"    column="f_opt_name"    />
        <result property="fAddTime"    column="f_add_time"    />
        <result property="fUpTime"    column="f_up_time"    />
        <result property="fState"    column="f_state"    />
        <result property="fUpOptName"    column="f_up_opt_name"    />
        <result property="fPChkDate"    column="f_p_chk_date"    />
        <result property="fNChkDate"    column="f_n_chk_date"    />
        <result property="fProductDate"    column="f_product_date"    />
        <result property="fDiscardDate"    column="f_discard_date"    />
        <result property="fSafeJudgeDate"    column="f_safe_judge_date"    />
        <result property="fGPressure"    column="f_g_pressure"    />
        <result property="fWPressure"    column="f_w_pressure"    />
        <result property="fSelfWeight"    column="f_self_weight"    />
        <result property="fThickness"    column="f_thickness"    />
        <result property="fPermitNo"    column="f_permit_no"    />
        <result property="fValveName"    column="f_valve_name"    />
        <result property="fPayImage"    column="f_pay_image"    />
        <result property="fBatchImage"    column="f_batch_image"    />
        <result property="fDeviceImage"    column="f_device_image"    />
        <result property="fCheckImage"    column="f_check_image"    />
        <result property="fEquNoImage"    column="f_equ_no_image"    />
        <result property="fSelfIdImage"    column="f_self_id_image"    />
        <result property="fBotImage"    column="f_bot_image"    />
        <result property="fBotSpecName"    column="f_bot_spec_name"    />
        <result property="fBottleType"    column="f_bottle_type"    />
        <result property="fInspectedTimes"    column="f_inspected_times"    />
        <result property="fIsSpecialized"    column="f_is_specialized"    />
        <result property="fValveManuFacturer"    column="f_valve_manu_facturer"    />
        <result property="fInspectionLabel"    column="f_inspection_label"    />
        <result property="fThirdPartyLabel"    column="f_third_party_label"    />
        <result property="fHoleCode"    column="f_hole_code"    />
        <result property="fBottleStorageType"    column="f_bottle_storage_type"    />
xulihui's avatar
xulihui committed
53
        <result property="fRowVersion"    column="f_row_version"    />
54 55 56 57 58 59 60
    </resultMap>

    <sql id="selectTLpgGasBottleFilesVo">
        select f_gas_bottle_files_id, f_reg_code, f_equ_no, f_equ_type, f_medium, f_make_date, f_make_info, f_self_id,f_pressure, f_volume, f_app_id, f_q_rcode,f_build_user,f_p_chk_date, f_n_chk_date, f_product_date, f_discard_date, f_safe_judge_date, f_g_pressure, f_w_pressure, f_self_weight, f_thickness, f_permit_no, f_valve_name, f_pay_image, f_batch_image, f_device_image, f_check_image, f_equ_no_image, f_self_id_image, f_bot_image, f_bot_spec_name, f_bottle_type, f_inspected_times,
               ( CASE f_is_specialized WHEN '1' THEN '专用' WHEN '2' THEN '托管' ELSE '-' END ) AS f_is_specialized,
               f_valve_manu_facturer, f_inspection_label, f_third_party_label, f_hole_code, f_bottle_storage_type,
               ( CASE f_state WHEN '1' THEN '新增' WHEN '2' THEN '修改' WHEN '-1' THEN '删除' ELSE '-' END ) AS f_state,
xulihui's avatar
xulihui committed
61
               f_opt_name, f_add_time, f_up_time, f_up_opt_name, f_row_version from t_lpg_gas_bottle_files
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
    </sql>

    <select id="selectTLpgGasBottleFilesList" parameterType="TLpgGasBottleFiles" resultMap="TLpgGasBottleFilesResult">
        <include refid="selectTLpgGasBottleFilesVo"/>
        <where>  
            <if test="fPChkDate != null "> and f_p_chk_date = #{fPChkDate}</if>
            <if test="fNChkDate != null "> and f_n_chk_date = #{fNChkDate}</if>
            <if test="fProductDate != null "> and f_product_date = #{fProductDate}</if>
            <if test="fDiscardDate != null "> and f_discard_date = #{fDiscardDate}</if>
            <if test="fSafeJudgeDate != null "> and f_safe_judge_date = #{fSafeJudgeDate}</if>
            <if test="fGPressure != null "> and f_g_pressure = #{fGPressure}</if>
            <if test="fWPressure != null "> and f_w_pressure = #{fWPressure}</if>
            <if test="fSelfWeight != null "> and f_self_weight = #{fSelfWeight}</if>
            <if test="fPermitNo != null  and fPermitNo != ''"> and f_permit_no = #{fPermitNo}</if>
            <if test="fValveName != null "> and f_valve_name like concat('%', #{fValveName}, '%')</if>
77
            <if test="fQRcode != null and fQRcode != ''"> and f_q_rcode like concat('%', #{fQRcode}, '%')</if>
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 131 132 133 134
            <if test="fState != null "> and f_state = #{fState}</if>
        </where>
    </select>
    
    <select id="selectTLpgGasBottleFilesById" parameterType="Long" resultMap="TLpgGasBottleFilesResult">
        <include refid="selectTLpgGasBottleFilesVo"/>
        where f_gas_bottle_files_id = #{fGasBottleFilesId}
    </select>
        
    <insert id="insertTLpgGasBottleFiles" parameterType="TLpgGasBottleFiles" useGeneratedKeys="true" keyProperty="fGasBottleFilesId">
        insert into t_lpg_gas_bottle_files
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fRegCode != null">f_reg_code,</if>
            <if test="fEquNo != null">f_equ_no,</if>
            <if test="fEquType != null">f_equ_type,</if>
            <if test="fMedium != null">f_medium,</if>
            <if test="fMakeDate != null">f_make_date,</if>
            <if test="fMakeInfo != null">f_make_info,</if>
            <if test="fSelfId != null">f_self_id,</if>

            <if test="fPressure != null">f_pressure,</if>
            <if test="fVolume != null">f_volume,</if>
            <if test="fAppId != null">f_app_id,</if>
            <if test="fQRcode != null">f_q_rcode,</if>
            <if test="fBuildUser != null">f_build_user,</if>
            <if test="fPChkDate != null">f_p_chk_date,</if>
            <if test="fNChkDate != null">f_n_chk_date,</if>
            <if test="fProductDate != null">f_product_date,</if>
            <if test="fDiscardDate != null">f_discard_date,</if>
            <if test="fSafeJudgeDate != null">f_safe_judge_date,</if>
            <if test="fGPressure != null">f_g_pressure,</if>
            <if test="fWPressure != null">f_w_pressure,</if>
            <if test="fSelfWeight != null">f_self_weight,</if>
            <if test="fThickness != null">f_thickness,</if>
            <if test="fPermitNo != null">f_permit_no,</if>
            <if test="fValveName != null">f_valve_name,</if>
            <if test="fPayImage != null">f_pay_image,</if>
            <if test="fBatchImage != null">f_batch_image,</if>
            <if test="fDeviceImage != null">f_device_image,</if>
            <if test="fCheckImage != null">f_check_image,</if>
            <if test="fEquNoImage != null">f_equ_no_image,</if>
            <if test="fSelfIdImage != null">f_self_id_image,</if>
            <if test="fBotImage != null">f_bot_image,</if>
            <if test="fBotSpecName != null">f_bot_spec_name,</if>
            <if test="fBottleType != null">f_bottle_type,</if>
            <if test="fInspectedTimes != null">f_inspected_times,</if>
            <if test="fIsSpecialized != null">f_is_specialized,</if>
            <if test="fValveManuFacturer != null">f_valve_manu_facturer,</if>
            <if test="fInspectionLabel != null">f_inspection_label,</if>
            <if test="fThirdPartyLabel != null">f_third_party_label,</if>
            <if test="fHoleCode != null">f_hole_code,</if>
            <if test="fBottleStorageType != null">f_bottle_storage_type,</if>
            <if test="fState != null">f_state,</if>
            <if test="fOptName != null">f_opt_name,</if>
            <if test="fAddTime != null">f_add_time,</if>
            <if test="fUpTime != null">f_up_time,</if>
            <if test="fUpOptName != null">f_up_opt_name,</if>
xulihui's avatar
xulihui committed
135
            <if test="fRowVersion != null">f_row_version,</if>
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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fRegCode != null">#{fRegCode},</if>
            <if test="fEquNo != null">#{fEquNo},</if>
            <if test="fEquType != null">#{fEquType},</if>
            <if test="fMedium != null">#{fMedium},</if>
            <if test="fMakeDate != null">#{fMakeDate},</if>
            <if test="fMakeInfo != null">#{fMakeInfo},</if>
            <if test="fSelfId != null">#{fSelfId},</if>

            <if test="fPressure != null">#{fPressure},</if>
            <if test="fVolume != null">#{fVolume},</if>
            <if test="fAppId != null">#{fAppId},</if>
            <if test="fQRcode != null">#{fQRcode},</if>
            <if test="fBuildUser != null">#{fBuildUser},</if>
            <if test="fPChkDate != null">#{fPChkDate},</if>
            <if test="fNChkDate != null">#{fNChkDate},</if>
            <if test="fProductDate != null">#{fProductDate},</if>
            <if test="fDiscardDate != null">#{fDiscardDate},</if>
            <if test="fSafeJudgeDate != null">#{fSafeJudgeDate},</if>
            <if test="fGPressure != null">#{fGPressure},</if>
            <if test="fWPressure != null">#{fWPressure},</if>
            <if test="fSelfWeight != null">#{fSelfWeight},</if>
            <if test="fThickness != null">#{fThickness},</if>
            <if test="fPermitNo != null">#{fPermitNo},</if>
            <if test="fValveName != null">#{fValveName},</if>
            <if test="fPayImage != null">#{fPayImage},</if>
            <if test="fBatchImage != null">#{fBatchImage},</if>
            <if test="fDeviceImage != null">#{fDeviceImage},</if>
            <if test="fCheckImage != null">#{fCheckImage},</if>
            <if test="fEquNoImage != null">#{fEquNoImage},</if>
            <if test="fSelfIdImage != null">#{fSelfIdImage},</if>
            <if test="fBotImage != null">#{fBotImage},</if>
            <if test="fBotSpecName != null">#{fBotSpecName},</if>
            <if test="fBottleType != null">#{fBottleType},</if>
            <if test="fInspectedTimes != null">#{fInspectedTimes},</if>
            <if test="fIsSpecialized != null">#{fIsSpecialized},</if>
            <if test="fValveManuFacturer != null">#{fValveManuFacturer},</if>
            <if test="fInspectionLabel != null">#{fInspectionLabel},</if>
            <if test="fThirdPartyLabel != null">#{fThirdPartyLabel},</if>
            <if test="fHoleCode != null">#{fHoleCode},</if>
            <if test="fBottleStorageType != null">#{fBottleStorageType},</if>
            <if test="fState != null">#{fState},</if>
            <if test="fOptName != null">#{fOptName},</if>
            <if test="fAddTime != null">#{fAddTime},</if>
            <if test="fUpTime != null">#{fUpTime},</if>

            <if test="fUpOptName != null">#{fUpOptName},</if>
xulihui's avatar
xulihui committed
184
            <if test="fRowVersion != null">#{fRowVersion},</if>
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
         </trim>
    </insert>

    <update id="updateTLpgGasBottleFiles" parameterType="TLpgGasBottleFiles">
        update t_lpg_gas_bottle_files
        <trim prefix="SET" suffixOverrides=",">
            <if test="fRegCode != null">f_reg_code = #{fRegCode},</if>
            <if test="fEquNo != null">f_equ_no = #{fEquNo},</if>
            <if test="fEquType != null">f_equ_type = #{fEquType},</if>
            <if test="fMedium != null">f_medium = #{fMedium},</if>
            <if test="fMakeDate != null">f_make_date = #{fMakeDate},</if>
            <if test="fMakeInfo != null">f_make_info = #{fMakeInfo},</if>
            <if test="fSelfId != null">f_self_id = #{fSelfId},</if>

            <if test="fPressure != null">f_pressure = #{fPressure},</if>
            <if test="fVolume != null">f_volume = #{fVolume},</if>
            <if test="fAppId != null">f_app_id = #{fAppId},</if>
            <if test="fQRcode != null">f_q_rcode = #{fQRcode},</if>
            <if test="fBuildUser != null">f_build_user = #{fBuildUser},</if>
            <if test="fPChkDate != null">f_p_chk_date = #{fPChkDate},</if>
            <if test="fNChkDate != null">f_n_chk_date = #{fNChkDate},</if>
            <if test="fProductDate != null">f_product_date = #{fProductDate},</if>
            <if test="fDiscardDate != null">f_discard_date = #{fDiscardDate},</if>
            <if test="fSafeJudgeDate != null">f_safe_judge_date = #{fSafeJudgeDate},</if>
            <if test="fGPressure != null">f_g_pressure = #{fGPressure},</if>
            <if test="fWPressure != null">f_w_pressure = #{fWPressure},</if>
            <if test="fSelfWeight != null">f_self_weight = #{fSelfWeight},</if>
            <if test="fThickness != null">f_thickness = #{fThickness},</if>
            <if test="fPermitNo != null">f_permit_no = #{fPermitNo},</if>
            <if test="fValveName != null">f_valve_name = #{fValveName},</if>
            <if test="fPayImage != null">f_pay_image = #{fPayImage},</if>
            <if test="fBatchImage != null">f_batch_image = #{fBatchImage},</if>
            <if test="fDeviceImage != null">f_device_image = #{fDeviceImage},</if>
            <if test="fCheckImage != null">f_check_image = #{fCheckImage},</if>
            <if test="fEquNoImage != null">f_equ_no_image = #{fEquNoImage},</if>
            <if test="fSelfIdImage != null">f_self_id_image = #{fSelfIdImage},</if>
            <if test="fBotImage != null">f_bot_image = #{fBotImage},</if>
            <if test="fBotSpecName != null">f_bot_spec_name = #{fBotSpecName},</if>
            <if test="fBottleType != null">f_bottle_type = #{fBottleType},</if>
            <if test="fInspectedTimes != null">f_inspected_times = #{fInspectedTimes},</if>
            <if test="fIsSpecialized != null">f_is_specialized = #{fIsSpecialized},</if>
            <if test="fValveManuFacturer != null">f_valve_manu_facturer = #{fValveManuFacturer},</if>
            <if test="fInspectionLabel != null">f_inspection_label = #{fInspectionLabel},</if>
            <if test="fThirdPartyLabel != null">f_third_party_label = #{fThirdPartyLabel},</if>
            <if test="fHoleCode != null">f_hole_code = #{fHoleCode},</if>
            <if test="fBottleStorageType != null">f_bottle_storage_type = #{fBottleStorageType},</if>
            <if test="fState != null">f_state = #{fState},</if>
            <if test="fOptName != null">f_opt_name = #{fOptName},</if>
            <if test="fAddTime != null">f_add_time = #{fAddTime},</if>
            <if test="fUpTime != null">f_up_time = #{fUpTime},</if>
            <if test="fUpOptName != null">f_up_opt_name = #{fUpOptName},</if>
xulihui's avatar
xulihui committed
236
            <if test="fRowVersion != null">f_row_version = #{fRowVersion},</if>
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
        </trim>
        where f_gas_bottle_files_id = #{fGasBottleFilesId}
    </update>

    <delete id="deleteTLpgGasBottleFilesById" parameterType="Long">
        delete from t_lpg_gas_bottle_files where f_gas_bottle_files_id = #{fGasBottleFilesId}
    </delete>

    <delete id="deleteTLpgGasBottleFilesByIds" parameterType="String">
        delete from t_lpg_gas_bottle_files where f_gas_bottle_files_id in 
        <foreach item="fGasBottleFilesId" collection="array" open="(" separator="," close=")">
            #{fGasBottleFilesId}
        </foreach>
    </delete>
</mapper>