TSupBalStopSupMapper.xml 9.06 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?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.TSupBalStopSupMapper">
    
    <resultMap type="TSupBalStopSup" id="TSupBalStopSupResult">
        <result property="fGasStopId"    column="f_gas_stop_id"    />
        <result property="fCompanyInfoId"    column="f_company_info_id"    />
        <result property="fStartDate"    column="f_start_date"    />
        <result property="fEndDate"    column="f_end_date"    />
        <result property="fStopType"    column="f_stop_type"    />
        <result property="fInfluenceCus"    column="f_influence_cus"    />
        <result property="fStopReason"    column="f_stop_reason"    />
        <result property="fStopRange"    column="f_stop_range"    />
        <result property="fStopProgress"    column="f_stop_progress"    />
        <result property="fRecoveryGasTime"    column="f_recovery_gas_time"    />
        <result property="fRepStatus"    column="f_rep_status"    />
19
        <result property="entRepTime"    column="f_ent_rep_time"    />
耿迪迪's avatar
耿迪迪 committed
20 21 22 23 24 25 26
        <result property="fGasStopArea"    column="f_gas_stop_area"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="isDel"    column="is_del"    />
        <result property="remarks"    column="remarks"    />
耿迪迪's avatar
耿迪迪 committed
27 28
        <result property="fGovUploadStatus"    column="f_gov_upload_status"    />
        <result property="fGovUploadTime"    column="f_gov_upload_time"    />
耿迪迪's avatar
耿迪迪 committed
29 30 31
    </resultMap>

    <sql id="selectTSupBalStopSupVo">
耿迪迪's avatar
耿迪迪 committed
32 33 34 35 36 37 38 39 40 41 42 43
        SELECT
            st.f_gas_stop_id,
            st.f_company_info_id,
            st.f_start_date,
            st.f_end_date,
            st.f_stop_type,
            st.f_influence_cus,
            st.f_stop_reason,
            st.f_stop_range,
            st.f_stop_progress,
            st.f_recovery_gas_time,
            st.f_rep_status,
44
            st.f_ent_rep_time,
耿迪迪's avatar
耿迪迪 committed
45 46 47 48 49 50 51
            st.f_gas_stop_area,
            st.create_by,
            st.create_time,
            st.update_by,
            st.update_time,
            st.is_del,
            st.remarks,
耿迪迪's avatar
耿迪迪 committed
52 53
            st.f_gov_upload_status,
            st.f_gov_upload_time,
耿迪迪's avatar
耿迪迪 committed
54 55 56 57
            en.enterprise_name AS enterpriseName
        FROM
            t_sup_bal_stop_sup st
        LEFT JOIN t_enterprise_info en ON en.enterprise_id = st.f_company_info_id
耿迪迪's avatar
耿迪迪 committed
58 59 60 61 62
    </sql>

    <select id="selectTSupBalStopSupList" parameterType="TSupBalStopSup" resultMap="TSupBalStopSupResult">
        <include refid="selectTSupBalStopSupVo"/>
        <where>  
耿迪迪's avatar
耿迪迪 committed
63 64 65 66 67
            <if test="fCompanyInfoId != null  and fCompanyInfoId != ''"> and st.f_company_info_id = #{fCompanyInfoId}</if>
            <if test="fStopType != null  and fStopType != ''"> and st.f_stop_type = #{fStopType}</if>
            <if test="fStopProgress != null  and fStopProgress != ''"> and st.f_stop_progress = #{fStopProgress}</if>
            <if test="fRepStatus != null  and fRepStatus != ''"> and st.f_rep_status = #{fRepStatus}</if>
            <if test="enterpriseName != null  and enterpriseName != ''"> and en.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
耿迪迪's avatar
耿迪迪 committed
68 69
            <if test="fGovUploadStatus != null  and fGovUploadStatus != ''"> and st.f_gov_upload_status = #{fGovUploadStatus}</if>
            <if test="fGovUploadTime != null "> and st.f_gov_upload_time = #{fGovUploadTime}</if>
耿迪迪's avatar
耿迪迪 committed
70
        </where>
71
        order by st.create_time desc
耿迪迪's avatar
耿迪迪 committed
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
    </select>
    
    <select id="selectTSupBalStopSupById" parameterType="Long" resultMap="TSupBalStopSupResult">
        <include refid="selectTSupBalStopSupVo"/>
        where f_gas_stop_id = #{fGasStopId}
    </select>
        
    <insert id="insertTSupBalStopSup" parameterType="TSupBalStopSup" useGeneratedKeys="true" keyProperty="fGasStopId">
        insert into t_sup_bal_stop_sup
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fCompanyInfoId != null">f_company_info_id,</if>
            <if test="fStartDate != null">f_start_date,</if>
            <if test="fEndDate != null">f_end_date,</if>
            <if test="fStopType != null and fStopType != ''">f_stop_type,</if>
            <if test="fInfluenceCus != null">f_influence_cus,</if>
            <if test="fStopReason != null">f_stop_reason,</if>
            <if test="fStopRange != null and fStopRange != ''">f_stop_range,</if>
            <if test="fStopProgress != null and fStopProgress != ''">f_stop_progress,</if>
            <if test="fRecoveryGasTime != null">f_recovery_gas_time,</if>
            <if test="fRepStatus != null and fRepStatus != ''">f_rep_status,</if>
耿迪迪's avatar
耿迪迪 committed
92
            <if test="entRepTime != null">f_ent_rep_time,</if>
耿迪迪's avatar
耿迪迪 committed
93 94 95 96 97 98 99
            <if test="fGasStopArea != null">f_gas_stop_area,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="isDel != null">is_del,</if>
            <if test="remarks != null">remarks,</if>
耿迪迪's avatar
耿迪迪 committed
100 101
            <if test="fGovUploadStatus != null">f_gov_upload_status,</if>
            <if test="fGovUploadTime != null">f_gov_upload_time,</if>
耿迪迪's avatar
耿迪迪 committed
102 103 104 105 106 107 108 109 110 111 112 113
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fCompanyInfoId != null">#{fCompanyInfoId},</if>
            <if test="fStartDate != null">#{fStartDate},</if>
            <if test="fEndDate != null">#{fEndDate},</if>
            <if test="fStopType != null and fStopType != ''">#{fStopType},</if>
            <if test="fInfluenceCus != null">#{fInfluenceCus},</if>
            <if test="fStopReason != null">#{fStopReason},</if>
            <if test="fStopRange != null and fStopRange != ''">#{fStopRange},</if>
            <if test="fStopProgress != null and fStopProgress != ''">#{fStopProgress},</if>
            <if test="fRecoveryGasTime != null">#{fRecoveryGasTime},</if>
            <if test="fRepStatus != null and fRepStatus != ''">#{fRepStatus},</if>
耿迪迪's avatar
耿迪迪 committed
114
            <if test="entRepTime != null">#{entRepTime},</if>
耿迪迪's avatar
耿迪迪 committed
115 116 117 118 119 120 121
            <if test="fGasStopArea != null">#{fGasStopArea},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="isDel != null">#{isDel},</if>
            <if test="remarks != null">#{remarks},</if>
耿迪迪's avatar
耿迪迪 committed
122 123
            <if test="fGovUploadStatus != null">#{fGovUploadStatus},</if>
            <if test="fGovUploadTime != null">#{fGovUploadTime},</if>
耿迪迪's avatar
耿迪迪 committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
         </trim>
    </insert>

    <update id="updateTSupBalStopSup" parameterType="TSupBalStopSup">
        update t_sup_bal_stop_sup
        <trim prefix="SET" suffixOverrides=",">
            <if test="fCompanyInfoId != null">f_company_info_id = #{fCompanyInfoId},</if>
            <if test="fStartDate != null">f_start_date = #{fStartDate},</if>
            <if test="fEndDate != null">f_end_date = #{fEndDate},</if>
            <if test="fStopType != null and fStopType != ''">f_stop_type = #{fStopType},</if>
            <if test="fInfluenceCus != null">f_influence_cus = #{fInfluenceCus},</if>
            <if test="fStopReason != null">f_stop_reason = #{fStopReason},</if>
            <if test="fStopRange != null and fStopRange != ''">f_stop_range = #{fStopRange},</if>
            <if test="fStopProgress != null and fStopProgress != ''">f_stop_progress = #{fStopProgress},</if>
            <if test="fRecoveryGasTime != null">f_recovery_gas_time = #{fRecoveryGasTime},</if>
            <if test="fRepStatus != null and fRepStatus != ''">f_rep_status = #{fRepStatus},</if>
耿迪迪's avatar
耿迪迪 committed
140
            <if test="entRepTime != null">f_ent_rep_time = #{entRepTime},</if>
耿迪迪's avatar
耿迪迪 committed
141 142 143 144 145 146 147
            <if test="fGasStopArea != null">f_gas_stop_area = #{fGasStopArea},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="isDel != null">is_del = #{isDel},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
耿迪迪's avatar
耿迪迪 committed
148 149
            <if test="fGovUploadStatus != null">f_gov_upload_status = #{fGovUploadStatus},</if>
            <if test="fGovUploadTime != null">f_gov_upload_time = #{fGovUploadTime},</if>
耿迪迪's avatar
耿迪迪 committed
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
        </trim>
        where f_gas_stop_id = #{fGasStopId}
    </update>

    <delete id="deleteTSupBalStopSupById" parameterType="Long">
        delete from t_sup_bal_stop_sup where f_gas_stop_id = #{fGasStopId}
    </delete>

    <delete id="deleteTSupBalStopSupByIds" parameterType="String">
        delete from t_sup_bal_stop_sup where f_gas_stop_id in 
        <foreach item="fGasStopId" collection="array" open="(" separator="," close=")">
            #{fGasStopId}
        </foreach>
    </delete>
</mapper>