OverseaCompanyInfoVerifyMapper.xml 7.23 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.overseaCompanyInfoVerify.mapper.OverseaCompanyInfoVerifyMapper">
    
    <resultMap type="OverseaCompanyInfoVerify" id="OverseaCompanyInfoVerifyResult">
        <result property="id"    column="id"    />
        <result property="countryCodeWb"    column="country_code_wb"    />
        <result property="countryCodeRb"    column="country_code_rb"    />
        <result property="countryName"    column="country_name"    />
        <result property="city"    column="city"    />
        <result property="enterpriseName"    column="enterpriseName"    />
        <result property="address"    column="address"    />
        <result property="postCode"    column="post_code"    />
        <result property="email"    column="email"    />
        <result property="phone"    column="phone"    />
        <result property="regNo"    column="reg_no"    />
        <result property="handStatus"    column="hand_status"    />
        <result property="attachment"    column="attachment"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>
	
	<sql id="selectOverseaCompanyInfoVerifyVo">
        select id, country_code_wb, country_code_rb, country_name, city, enterpriseName, address, post_code, email, phone, reg_no, hand_status,attachment,create_time from oversea_company_info_verify
    </sql>
	
    <select id="selectOverseaCompanyInfoVerifyList" parameterType="OverseaCompanyInfoVerify" resultMap="OverseaCompanyInfoVerifyResult">
        <include refid="selectOverseaCompanyInfoVerifyVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="countryCodeWb != null  and countryCodeWb != '' "> and country_code_wb = #{countryCodeWb}</if>
            <if test="countryCodeRb != null  and countryCodeRb != '' "> and country_code_rb = #{countryCodeRb}</if>
            <if test="countryName != null  and countryName != '' "> and country_name = #{countryName}</if>
            <if test="city != null  and city != '' "> and city = #{city}</if>
            <if test="enterpriseName != null  and enterpriseName != '' "> and enterpriseName = #{enterpriseName}</if>
            <if test="address != null  and address != '' "> and address = #{address}</if>
            <if test="postCode != null  and postCode != '' "> and post_code = #{postCode}</if>
            <if test="email != null  and email != '' "> and email = #{email}</if>
            <if test="phone != null  and phone != '' "> and phone = #{phone}</if>
            <if test="regNo != null "> and reg_no = #{regNo}</if>
            <if test="handStatus != null "> and hand_status = #{handStatus}</if>
            <if test="attachment != null "> and attachment = #{attachment}</if>
            <if test="beginTime !=null and beginTime !='' ">
                and create_time &gt;= #{beginTime}
            </if>
            <if test="endTime !=null and endTime !='' ">
                and create_time &lt;= #{endTime}
            </if>
        </where>
        order by create_time desc
    </select>
    
    <select id="selectOverseaCompanyInfoVerifyById" parameterType="Integer" resultMap="OverseaCompanyInfoVerifyResult">
        <include refid="selectOverseaCompanyInfoVerifyVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertOverseaCompanyInfoVerify" parameterType="OverseaCompanyInfoVerify" useGeneratedKeys="true" keyProperty="id">
        insert into oversea_company_info_verify
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="countryCodeWb != null  and countryCodeWb != ''  ">country_code_wb,</if>
			<if test="countryCodeRb != null  and countryCodeRb != ''  ">country_code_rb,</if>
			<if test="countryName != null  and countryName != ''  ">country_name,</if>
			<if test="city != null  and city != ''  ">city,</if>
			<if test="enterpriseName != null  and enterpriseName != ''  ">enterpriseName,</if>
			<if test="address != null  and address != ''  ">address,</if>
			<if test="postCode != null  and postCode != ''  ">post_code,</if>
			<if test="email != null  and email != ''  ">email,</if>
			<if test="phone != null  and phone != ''  ">phone,</if>
			<if test="regNo != null  and regNo != '' ">reg_no,</if>
			<if test="handStatus != null  ">hand_status,</if>
			<if test="attachment != null  ">attachment,</if>
			<if test="createTime != null  ">create_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="countryCodeWb != null  and countryCodeWb != ''  ">#{countryCodeWb},</if>
			<if test="countryCodeRb != null  and countryCodeRb != ''  ">#{countryCodeRb},</if>
			<if test="countryName != null  and countryName != ''  ">#{countryName},</if>
			<if test="city != null  and city != ''  ">#{city},</if>
			<if test="enterpriseName != null  and enterpriseName != ''  ">#{enterpriseName},</if>
			<if test="address != null  and address != ''  ">#{address},</if>
			<if test="postCode != null  and postCode != ''  ">#{postCode},</if>
			<if test="email != null  and email != ''  ">#{email},</if>
			<if test="phone != null  and phone != ''  ">#{phone},</if>
			<if test="regNo != null  and regNo != '' ">#{regNo},</if>
			<if test="handStatus != null  ">#{handStatus},</if>
			<if test="attachment != null  ">#{attachment},</if>
			<if test="createTime != null  ">#{createTime},</if>
         </trim>
    </insert>
	 
    <update id="updateOverseaCompanyInfoVerify" parameterType="OverseaCompanyInfoVerify">
        update oversea_company_info_verify
        <trim prefix="SET" suffixOverrides=",">
            <if test="countryCodeWb != null  and countryCodeWb != ''  ">country_code_wb = #{countryCodeWb},</if>
            <if test="countryCodeRb != null  and countryCodeRb != ''  ">country_code_rb = #{countryCodeRb},</if>
            <if test="countryName != null  and countryName != ''  ">country_name = #{countryName},</if>
            <if test="city != null  and city != ''  ">city = #{city},</if>
            <if test="enterpriseName != null  and enterpriseName != ''  ">enterpriseName = #{enterpriseName},</if>
            <if test="address != null  and address != ''  ">address = #{address},</if>
            <if test="postCode != null  and postCode != ''  ">post_code = #{postCode},</if>
            <if test="email != null  and email != ''  ">email = #{email},</if>
            <if test="phone != null  and phone != ''  ">phone = #{phone},</if>
            <if test="regNo != null  and regNo != '' ">reg_no = #{regNo},</if>
            <if test="handStatus != null  ">hand_status = #{handStatus},</if>
            <if test="attachment != null  ">attachment = #{attachment},</if>
            <if test="createTime != null  ">create_time = #{createTime},</if>
        </trim>
        where id = #{id}
    </update>

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