123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <?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.SaleOtherCollectionMapper">
-
- <resultMap type="com.zkqy.business.domain.SaleOtherCollection" id="SaleOtherCollectionResult">
- <result property="id" column="id" />
- <result property="serialNumber" column="serial_number" />
- <result property="otherCollectionDate" column="other_collection_date" />
- <result property="customerId" column="customer_id" />
- <result property="personInChargeId" column="person_in_charge_id" />
- <result property="paymentMethod" column="payment_method" />
- <result property="travelCertificateNumber" column="travel_certificate_number" />
- <result property="deptId" column="dept_id" />
- <result property="collectionDetails" column="collection_details" />
- <result property="itemReceivable" column="item_receivable" />
- <result property="settlementUnitId" column="settlement_unit_id"/>
- <result property="amount" column="amount" />
- <result property="auditor" column="auditor"/>
- <result property="bookkeepingFlag" column="bookkeeping_flag" />
- <result property="status" column="status" />
- <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" />
- <result property="settlementUnitName" column="customer_name"/>
- </resultMap>
- <sql id="selectSaleOtherCollectionVo">
- select id, serial_number, other_collection_date, customer_id, person_in_charge_id, payment_method, travel_certificate_number, dept_id, collection_details, item_receivable,settlement_unit_id, amount,auditor, bookkeeping_flag, status, remark, create_by, create_by_id, create_time, update_by, update_by_id, update_time, del_flag from {DBNAME}.sale_other_collection
- </sql>
- <select id="selectSaleOtherCollectionList" parameterType="com.zkqy.business.domain.SaleOtherCollection" resultMap="SaleOtherCollectionResult">
- SELECT
- soc.* ,
- csu.customer_name
- FROM
- {DBNAME}.sale_other_collection soc
- LEFT JOIN {DBNAME}.customer_settlement_unit csu ON soc.settlement_unit_id = csu.id
- where soc.del_flag = '0'
- <if test="serialNumber != null and serialNumber != ''"> and soc.serial_number = #{serialNumber}</if>
- <if test="otherCollectionDate != null "> and soc.other_collection_date = #{otherCollectionDate}</if>
- <if test="customerId != null "> and soc.customer_id = #{customerId}</if>
- <if test="personInChargeId != null "> and soc.person_in_charge_id = #{personInChargeId}</if>
- <if test="paymentMethod != null and paymentMethod != ''"> and soc.payment_method = #{paymentMethod}</if>
- <if test="travelCertificateNumber != null and travelCertificateNumber != ''"> and soc.travel_certificate_number = #{travelCertificateNumber}</if>
- <if test="deptId != null "> and soc.dept_id = #{deptId}</if>
- <if test="collectionDetails != null and collectionDetails != ''"> and soc.collection_details = #{collectionDetails}</if>
- <if test="itemReceivable != null and itemReceivable != ''"> and soc.item_receivable = #{itemReceivable}</if>
- <if test="settlementUnitId != null "> and soc.settlement_unit_id = #{settlementUnitId}</if>
- <if test="amount != null "> and soc.amount = #{amount}</if>
- <if test="bookkeepingFlag != null and bookkeepingFlag != ''"> and bookkeeping_flag = #{bookkeepingFlag}</if>
- <if test="status != null and status != ''"> and soc.status = #{status}</if>
- <if test="startTime != null and endTime != null">and soc.other_collection_date BETWEEN #{startTime} AND #{endTime}</if>
- order by soc.id desc
- </select>
-
- <select id="selectSaleOtherCollectionById" parameterType="Long" resultMap="SaleOtherCollectionResult">
- <include refid="selectSaleOtherCollectionVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertSaleOtherCollection" parameterType="com.zkqy.business.domain.SaleOtherCollection" useGeneratedKeys="true" keyProperty="id">
- insert into {DBNAME}.sale_other_collection
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="serialNumber != null">serial_number,</if>
- <if test="otherCollectionDate != null">other_collection_date,</if>
- <if test="customerId != null">customer_id,</if>
- <if test="personInChargeId != null">person_in_charge_id,</if>
- <if test="paymentMethod != null">payment_method,</if>
- <if test="travelCertificateNumber != null">travel_certificate_number,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="collectionDetails != null">collection_details,</if>
- <if test="itemReceivable != null">item_receivable,</if>
- <if test="settlementUnitId != null">settlement_unit_id,</if>
- <if test="amount != null">amount,</if>
- <if test="auditor != null">auditor,</if>
- <if test="bookkeepingFlag != null">bookkeeping_flag,</if>
- <if test="status != null">status,</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="serialNumber != null">#{serialNumber},</if>
- <if test="otherCollectionDate != null">#{otherCollectionDate},</if>
- <if test="customerId != null">#{customerId},</if>
- <if test="personInChargeId != null">#{personInChargeId},</if>
- <if test="paymentMethod != null">#{paymentMethod},</if>
- <if test="travelCertificateNumber != null">#{travelCertificateNumber},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="collectionDetails != null">#{collectionDetails},</if>
- <if test="itemReceivable != null">#{itemReceivable},</if>
- <if test="settlementUnitId != null">#{settlementUnitId},</if>
- <if test="amount != null">#{amount},</if>
- <if test="auditor != null">#{auditor},</if>
- <if test="bookkeepingFlag != null">#{bookkeepingFlag},</if>
- <if test="status != null">#{status},</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="updateSaleOtherCollection" parameterType="com.zkqy.business.domain.SaleOtherCollection">
- update {DBNAME}.sale_other_collection
- <trim prefix="SET" suffixOverrides=",">
- <if test="serialNumber != null">serial_number = #{serialNumber},</if>
- <if test="otherCollectionDate != null">other_collection_date = #{otherCollectionDate},</if>
- <if test="customerId != null">customer_id = #{customerId},</if>
- <if test="personInChargeId != null">person_in_charge_id = #{personInChargeId},</if>
- <if test="paymentMethod != null">payment_method = #{paymentMethod},</if>
- <if test="travelCertificateNumber != null">travel_certificate_number = #{travelCertificateNumber},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="collectionDetails != null">collection_details = #{collectionDetails},</if>
- <if test="itemReceivable != null">item_receivable = #{itemReceivable},</if>
- <if test="settlementUnitId != null">settlement_unit_id = #{settlementUnitId},</if>
- <if test="amount != null">amount = #{amount},</if>
- <if test="auditor != null">auditor = #{auditor},</if>
- <if test="bookkeepingFlag != null">bookkeeping_flag = #{bookkeepingFlag},</if>
- <if test="status != null">status = #{status},</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="deleteSaleOtherCollectionById" parameterType="Long">
- delete from {DBNAME}.sale_other_collection where id = #{id}
- </delete>
- <delete id="deleteSaleOtherCollectionByIds" parameterType="String">
- update {DBNAME}.sale_other_collection set del_flag = '2' where id in
- <foreach item="id" collection="list" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|