FrontWxMapper.xml 5.22 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.frontVx.mapper.FrontVxMapper">
    
    <resultMap type="FrontVx" id="FrontVxResult">
        <result property="id"    column="id"    />
        <result property="openId"    column="open_id"    />
        <result property="zname"    column="zname"    />
        <result property="phone"    column="phone"    />
        <result property="enterprise"    column="enterprise"    />
        <result property="intention"    column="intention"    />
        <result property="commend"    column="commend"    />
        <result property="card"    column="card"    />
        <result property="vxStatus"    column="vx_status"    />
    </resultMap>
	
	<sql id="selectFrontVxVo">
        select id, open_id, zname, phone, enterprise, intention, commend, card, vx_status from front_Vx
    </sql>
	
    <select id="selectFrontVxList" parameterType="FrontVx" resultMap="FrontVxResult">
        <include refid="selectFrontVxVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="openId != null  and openId != '' "> and open_id = #{openId}</if>
            <if test="zname != null  and zname != '' "> and zname = #{zname}</if>
            <if test="phone != null  and phone != '' "> and phone = #{phone}</if>
            <if test="enterprise != null  and enterprise != '' "> and enterprise = #{enterprise}</if>
            <if test="intention != null  and intention != '' "> and intention = #{intention}</if>
            <if test="commend != null  and commend != '' "> and commend = #{commend}</if>
            <if test="card != null  and card != '' "> and card = #{card}</if>
            <if test="vxStatus != null  and vxStatus != '' "> and vx_status = #{vxStatus}</if>
        </where>
    </select>
    
    <select id="selectFrontVxById" parameterType="Integer" resultMap="FrontVxResult">
        <include refid="selectFrontVxVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertFrontVx" parameterType="FrontVx">
        insert into front_Vx
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="id != null  ">id,</if>
			<if test="openId != null  and openId != ''  ">open_id,</if>
			<if test="zname != null  and zname != ''  ">zname,</if>
			<if test="phone != null  and phone != ''  ">phone,</if>
			<if test="enterprise != null  and enterprise != ''  ">enterprise,</if>
			<if test="intention != null  and intention != ''  ">intention,</if>
			<if test="commend != null  and commend != ''  ">commend,</if>
			<if test="card != null  and card != ''  ">card,</if>
            <if test="vxStatus != null  and vxStatus != ''  ">vx_status,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="id != null  ">#{id},</if>
			<if test="openId != null  and openId != ''  ">#{openId},</if>
			<if test="zname != null  and zname != ''  ">#{zname},</if>
			<if test="phone != null  and phone != ''  ">#{phone},</if>
			<if test="enterprise != null  and enterprise != ''  ">#{enterprise},</if>
			<if test="intention != null  and intention != ''  ">#{intention},</if>
			<if test="commend != null  and commend != ''  ">#{commend},</if>
			<if test="card != null  and card != ''  ">#{card},</if>
            <if test="vxStatus != null  and vxStatus != ''  ">#{vxStatus},</if>
         </trim>
    </insert>
	 
    <update id="updateFrontVx" parameterType="FrontVx">
        update front_Vx
        <trim prefix="SET" suffixOverrides=",">
            <if test="openId != null  and openId != ''  ">open_id = #{openId},</if>
            <if test="zname != null  and zname != ''  ">zname = #{zname},</if>
            <if test="phone != null  and phone != ''  ">phone = #{phone},</if>
            <if test="enterprise != null  and enterprise != ''  ">enterprise = #{enterprise},</if>
            <if test="intention != null  and intention != ''  ">intention = #{intention},</if>
            <if test="commend != null  and commend != ''  ">commend = #{commend},</if>
            <if test="card != null  and card != ''  ">card = #{card},</if>
            <if test="vxStatus != null  and vxStatus != ''  ">vx_status = #{vxStatus},</if>
        </trim>
        where id = #{id}
    </update>
    <update id="updateFrontVxByOpenId" parameterType="com.lhcredit.project.business.frontVx.domain.FrontVx">
        update front_Vx
        <trim prefix="SET" suffixOverrides=",">
            <if test="openId != null  and openId != ''  ">open_id = #{openId},</if>
            <if test="zname != null  and zname != ''  ">zname = #{zname},</if>
            <if test="phone != null  and phone != ''  ">phone = #{phone},</if>
            <if test="enterprise != null  and enterprise != ''  ">enterprise = #{enterprise},</if>
        </trim>
        where open_id = #{openId}
    </update>

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