123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?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.zkqy.business.mapper.CustomerSettlementUnitMapper">
-
- <resultMap type="com.zkqy.business.domain.CustomerSettlementUnit" id="CustomerSettlementUnitResult">
- <result property="id" column="id" />
- <result property="customerId" column="customer_id" />
- <result property="customerName" column="customer_name" />
- <result property="customerRegion" column="customer_region" />
- <result property="remark" column="remark" />
- <result property="createBy" column="create_by" />
- <result property="createById" column="create_by_id" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateById" column="update_by_id" />
- <result property="updateTime" column="update_time" />
- <result property="delFlag" column="del_flag" />
- </resultMap>
- <sql id="selectCustomerSettlementUnitVo">
- select id, customer_id, customer_name, customer_region, remark, create_by, create_by_id, create_time, update_by, update_by_id, update_time, del_flag from {DBNAME}.customer_settlement_unit
- </sql>
- <select id="selectCustomerSettlementUnitList" parameterType="com.zkqy.business.domain.CustomerSettlementUnit" resultMap="CustomerSettlementUnitResult">
- <include refid="selectCustomerSettlementUnitVo"/>
- where del_flag = '0'
- <if test="customerId != null "> and customer_id = #{customerId}</if>
- <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
- <if test="customerRegion != null and customerRegion != ''"> and customer_region = #{customerRegion}</if>
- </select>
-
- <select id="selectCustomerSettlementUnitById" parameterType="Long" resultMap="CustomerSettlementUnitResult">
- <include refid="selectCustomerSettlementUnitVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertCustomerSettlementUnit" parameterType="com.zkqy.business.domain.CustomerSettlementUnit" useGeneratedKeys="true" keyProperty="id">
- insert into {DBNAME}.customer_settlement_unit
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="customerId != null">customer_id,</if>
- <if test="customerName != null">customer_name,</if>
- <if test="customerRegion != null">customer_region,</if>
- <if test="remark != null">remark,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createById != null">create_by_id,</if>
- <if test="createTime != null">create_time,</if>
- del_flag
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="customerId != null">#{customerId},</if>
- <if test="customerName != null">#{customerName},</if>
- <if test="customerRegion != null">#{customerRegion},</if>
- <if test="remark != null">#{remark},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createById != null">#{createById},</if>
- <if test="createTime != null">#{createTime},</if>
- '0'
- </trim>
- </insert>
- <update id="updateCustomerSettlementUnit" parameterType="com.zkqy.business.domain.CustomerSettlementUnit">
- update {DBNAME}.customer_settlement_unit
- <trim prefix="SET" suffixOverrides=",">
- <if test="customerId != null">customer_id = #{customerId},</if>
- <if test="customerName != null">customer_name = #{customerName},</if>
- <if test="customerRegion != null">customer_region = #{customerRegion},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateById != null">update_by_id = #{updateById},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteCustomerSettlementUnitById" parameterType="Long">
- delete from customer_settlement_unit where id = #{id}
- </delete>
- <delete id="deleteCustomerSettlementUnitByIds" parameterType="String">
- update {DBNAME}.customer_settlement_unit set del_flag = '2' where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|