PiccErrOrderMapper.xml 7.25 KB
<?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.lhcredit.project.business.piccErrOrder.mapper.PiccErrOrderMapper">
    
    <resultMap type="PiccErrOrder" id="PiccErrOrderResult">
        <result property="id"    column="id"    />
        <result property="orderNum"    column="orderNum"    />
        <result property="enterpriseName"    column="enterpriseName"    />
        <result property="country"    column="country"    />
        <result property="address"    column="address"    />
        <result property="regNo"    column="regNo"    />
        <result property="taxNo"    column="taxNo"    />
        <result property="affiliation"    column="affiliation"    />
        <result property="reportType"    column="reportType"    />
        <result property="orderType"    column="orderType"    />
        <result property="status"    column="status"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="limitnum"    column="limitnum"    />
        <result property="affiliationAll"    column="affiliation_all"    />
    </resultMap>
	
	<sql id="selectPiccErrOrderVo">
        select id, orderNum, enterpriseName, country, address, regNo, taxNo, affiliation, reportType, orderType, status, create_time, update_time,limitnum,affiliation_all from picc_err_order
    </sql>
	
    <select id="selectPiccErrOrderList" parameterType="PiccErrOrder" resultMap="PiccErrOrderResult">
        <include refid="selectPiccErrOrderVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="orderNum != null  and orderNum != '' "> and orderNum like  concat('%',#{orderNum},'%')</if>
            <if test="enterpriseName != null  and enterpriseName != '' "> and enterpriseName like  concat('%',#{enterpriseName},'%')</if>
            <if test="country != null  and country != '' "> and country like  concat('%', #{country},'%')</if>
            <if test="address != null  and address != '' "> and address = #{address}</if>
            <if test="regNo != null  and regNo != '' "> and regNo = #{regNo}</if>
            <if test="taxNo != null  and taxNo != '' "> and taxNo = #{taxNo}</if>
            <if test="affiliation != null  and affiliation != '' "> and affiliation like  concat('%',#{affiliation},'%')</if>
            <if test="reportType != null  and reportType != '' "> and reportType = #{reportType}</if>
            <if test="orderType != null  and orderType != '' "> and orderType = #{orderType}</if>
            <if test="status != null  and status != '' "> and status = #{status}</if>
            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
                AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
            </if>
            <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
                AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
            </if>
            <if test="updateTime != null "> and update_time = #{updateTime}</if>
        </where>
    </select>
    
    <select id="selectPiccErrOrderById" parameterType="Integer" resultMap="PiccErrOrderResult">
        <include refid="selectPiccErrOrderVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertPiccErrOrder" parameterType="PiccErrOrder" useGeneratedKeys="true" keyProperty="id">
        insert into picc_err_order
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="orderNum != null  and orderNum != ''  ">orderNum,</if>
			<if test="enterpriseName != null  and enterpriseName != ''  ">enterpriseName,</if>
			<if test="country != null  and country != ''  ">country,</if>
			<if test="address != null  and address != ''  ">address,</if>
			<if test="regNo != null  and regNo != ''  ">regNo,</if>
			<if test="taxNo != null  and taxNo != ''  ">taxNo,</if>
			<if test="affiliation != null  and affiliation != ''  ">affiliation,</if>
			<if test="reportType != null  and reportType != ''  ">reportType,</if>
			<if test="orderType != null  and orderType != ''  ">orderType,</if>
			<if test="status != null  and status != ''  ">status,</if>
			<if test="createTime != null  ">create_time,</if>
			<if test="updateTime != null  ">update_time,</if>
			<if test="limitnum != null and limitnum != '' ">limitnum,</if>
			<if test="affiliationAll != null and affiliationAll != '' ">affiliation_all,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="orderNum != null  and orderNum != ''  ">#{orderNum},</if>
			<if test="enterpriseName != null  and enterpriseName != ''  ">#{enterpriseName},</if>
			<if test="country != null  and country != ''  ">#{country},</if>
			<if test="address != null  and address != ''  ">#{address},</if>
			<if test="regNo != null  and regNo != ''  ">#{regNo},</if>
			<if test="taxNo != null  and taxNo != ''  ">#{taxNo},</if>
			<if test="affiliation != null  and affiliation != ''  ">#{affiliation},</if>
			<if test="reportType != null  and reportType != ''  ">#{reportType},</if>
			<if test="orderType != null  and orderType != ''  ">#{orderType},</if>
			<if test="status != null  and status != ''  ">#{status},</if>
			<if test="createTime != null  ">#{createTime},</if>
			<if test="updateTime != null  ">#{updateTime},</if>
			<if test="limitnum != null  and limitnum != ''">#{limitnum},</if>
            <if test="affiliationAll != null and affiliationAll != '' ">#{affiliationAll},</if>
         </trim>
    </insert>
	 
    <update id="updatePiccErrOrder" parameterType="PiccErrOrder">
        update picc_err_order
        <trim prefix="SET" suffixOverrides=",">
            <if test="orderNum != null  and orderNum != ''  ">orderNum = #{orderNum},</if>
            <if test="enterpriseName != null  and enterpriseName != ''  ">enterpriseName = #{enterpriseName},</if>
            <if test="country != null  and country != ''  ">country = #{country},</if>
            <if test="address != null  and address != ''  ">address = #{address},</if>
            <if test="regNo != null  and regNo != ''  ">regNo = #{regNo},</if>
            <if test="taxNo != null  and taxNo != ''  ">taxNo = #{taxNo},</if>
            <if test="affiliation != null  and affiliation != ''  ">affiliation = #{affiliation},</if>
            <if test="reportType != null  and reportType != ''  ">reportType = #{reportType},</if>
            <if test="orderType != null  and orderType != ''  ">orderType = #{orderType},</if>
            <if test="status != null  and status != ''  ">status = #{status},</if>
            <if test="createTime != null  ">create_time = #{createTime},</if>
            <if test="updateTime != null  ">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>

	<delete id="deletePiccErrOrderById" parameterType="Integer">
        delete from picc_err_order where id = #{id}
    </delete>
	
    <delete id="deletePiccErrOrderByIds" parameterType="String">
        delete from picc_err_order where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>