203 lines
14 KiB
XML
203 lines
14 KiB
XML
|
|
<?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.bonus.canteen.core.ims.mapper.PurchaseContractMapper">
|
||
|
|
<resultMap type="com.bonus.canteen.core.ims.domain.PurchaseContract" id="PurchaseContractResult">
|
||
|
|
<result property="contractId" column="contract_id" />
|
||
|
|
<result property="contractCode" column="contract_code" />
|
||
|
|
<result property="supplierId" column="supplier_id" />
|
||
|
|
<result property="commitStatus" column="commit_status" />
|
||
|
|
<result property="contractStatus" column="contract_status" />
|
||
|
|
<result property="contractAmount" column="contract_amount" />
|
||
|
|
<result property="orderGoodsAmount" column="order_goods_amount" />
|
||
|
|
<result property="contractSigningTime" column="contract_signing_time" />
|
||
|
|
<result property="remark" column="remark" />
|
||
|
|
<result property="canteenId" column="canteen_id" />
|
||
|
|
<result property="contractTitle" column="contract_title" />
|
||
|
|
<result property="contractStartTime" column="contract_start_time" />
|
||
|
|
<result property="contractEndTime" column="contract_end_time" />
|
||
|
|
<result property="approveStatus" column="approve_status" />
|
||
|
|
<result property="processInstanceId" column="process_instance_id" />
|
||
|
|
<result property="approveBy" column="approve_by" />
|
||
|
|
<result property="approveTime" column="approve_time" />
|
||
|
|
<result property="approveRemark" column="approve_remark" />
|
||
|
|
<result property="totalNum" column="total_num" />
|
||
|
|
<result property="categoryNum" column="category_num" />
|
||
|
|
<result property="payMoneyStyle" column="pay_money_style" />
|
||
|
|
<result property="payMoneyDate" column="pay_money_date" />
|
||
|
|
<result property="collectMoneyBank" column="collect_money_bank" />
|
||
|
|
<result property="collectMoneyAccount" column="collect_money_account" />
|
||
|
|
<result property="collectMoneyAccountName" column="collect_money_account_name" />
|
||
|
|
<result property="payRemark" column="pay_remark" />
|
||
|
|
<result property="contractAttachment" column="contract_attachment" />
|
||
|
|
<result property="contractPerson" column="contract_person" />
|
||
|
|
<result property="delFlag" column="del_flag" />
|
||
|
|
<result property="createBy" column="create_by" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="updateBy" column="update_by" />
|
||
|
|
<result property="updateTime" column="update_time" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectPurchaseContractVo">
|
||
|
|
select contract_id, contract_code, supplier_id, commit_status, contract_status, contract_amount, order_goods_amount, contract_signing_time, remark, canteen_id, contract_title, contract_start_time, contract_end_time, approve_status, process_instance_id, approve_by, approve_time, approve_remark, total_num, category_num, pay_money_style, pay_money_date, collect_money_bank, collect_money_account, collect_money_account_name, pay_remark, contract_attachment, contract_person, del_flag, create_by, create_time, update_by, update_time from ims_purchase_contract
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectPurchaseContractList" parameterType="com.bonus.canteen.core.ims.domain.PurchaseContract" resultMap="PurchaseContractResult">
|
||
|
|
<include refid="selectPurchaseContractVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="supplierId != null "> and supplier_id = #{supplierId}</if>
|
||
|
|
<if test="commitStatus != null "> and commit_status = #{commitStatus}</if>
|
||
|
|
<if test="contractStatus != null "> and contract_status = #{contractStatus}</if>
|
||
|
|
<if test="contractAmount != null "> and contract_amount = #{contractAmount}</if>
|
||
|
|
<if test="orderGoodsAmount != null "> and order_goods_amount = #{orderGoodsAmount}</if>
|
||
|
|
<if test="contractSigningTime != null "> and contract_signing_time = #{contractSigningTime}</if>
|
||
|
|
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
|
||
|
|
<if test="contractTitle != null and contractTitle != ''"> and contract_title = #{contractTitle}</if>
|
||
|
|
<if test="contractStartTime != null "> and contract_start_time = #{contractStartTime}</if>
|
||
|
|
<if test="contractEndTime != null "> and contract_end_time = #{contractEndTime}</if>
|
||
|
|
<if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
|
||
|
|
<if test="processInstanceId != null "> and process_instance_id = #{processInstanceId}</if>
|
||
|
|
<if test="approveBy != null and approveBy != ''"> and approve_by = #{approveBy}</if>
|
||
|
|
<if test="approveTime != null "> and approve_time = #{approveTime}</if>
|
||
|
|
<if test="approveRemark != null and approveRemark != ''"> and approve_remark = #{approveRemark}</if>
|
||
|
|
<if test="totalNum != null "> and total_num = #{totalNum}</if>
|
||
|
|
<if test="categoryNum != null "> and category_num = #{categoryNum}</if>
|
||
|
|
<if test="payMoneyStyle != null "> and pay_money_style = #{payMoneyStyle}</if>
|
||
|
|
<if test="payMoneyDate != null "> and pay_money_date = #{payMoneyDate}</if>
|
||
|
|
<if test="collectMoneyBank != null and collectMoneyBank != ''"> and collect_money_bank = #{collectMoneyBank}</if>
|
||
|
|
<if test="collectMoneyAccount != null and collectMoneyAccount != ''"> and collect_money_account = #{collectMoneyAccount}</if>
|
||
|
|
<if test="collectMoneyAccountName != null and collectMoneyAccountName != ''"> and collect_money_account_name like concat('%', #{collectMoneyAccountName}, '%')</if>
|
||
|
|
<if test="payRemark != null and payRemark != ''"> and pay_remark = #{payRemark}</if>
|
||
|
|
<if test="contractAttachment != null and contractAttachment != ''"> and contract_attachment = #{contractAttachment}</if>
|
||
|
|
<if test="contractPerson != null and contractPerson != ''"> and contract_person = #{contractPerson}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectPurchaseContractByContractId" parameterType="Long" resultMap="PurchaseContractResult">
|
||
|
|
<include refid="selectPurchaseContractVo"/>
|
||
|
|
where contract_id = #{contractId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertPurchaseContract" parameterType="com.bonus.canteen.core.ims.domain.PurchaseContract" useGeneratedKeys="true" keyProperty="contractId">
|
||
|
|
insert into ims_purchase_contract
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="contractCode != null">contract_code,</if>
|
||
|
|
<if test="supplierId != null">supplier_id,</if>
|
||
|
|
<if test="commitStatus != null">commit_status,</if>
|
||
|
|
<if test="contractStatus != null">contract_status,</if>
|
||
|
|
<if test="contractAmount != null">contract_amount,</if>
|
||
|
|
<if test="orderGoodsAmount != null">order_goods_amount,</if>
|
||
|
|
<if test="contractSigningTime != null">contract_signing_time,</if>
|
||
|
|
<if test="remark != null">remark,</if>
|
||
|
|
<if test="canteenId != null">canteen_id,</if>
|
||
|
|
<if test="contractTitle != null">contract_title,</if>
|
||
|
|
<if test="contractStartTime != null">contract_start_time,</if>
|
||
|
|
<if test="contractEndTime != null">contract_end_time,</if>
|
||
|
|
<if test="approveStatus != null">approve_status,</if>
|
||
|
|
<if test="processInstanceId != null">process_instance_id,</if>
|
||
|
|
<if test="approveBy != null">approve_by,</if>
|
||
|
|
<if test="approveTime != null">approve_time,</if>
|
||
|
|
<if test="approveRemark != null">approve_remark,</if>
|
||
|
|
<if test="totalNum != null">total_num,</if>
|
||
|
|
<if test="categoryNum != null">category_num,</if>
|
||
|
|
<if test="payMoneyStyle != null">pay_money_style,</if>
|
||
|
|
<if test="payMoneyDate != null">pay_money_date,</if>
|
||
|
|
<if test="collectMoneyBank != null">collect_money_bank,</if>
|
||
|
|
<if test="collectMoneyAccount != null">collect_money_account,</if>
|
||
|
|
<if test="collectMoneyAccountName != null">collect_money_account_name,</if>
|
||
|
|
<if test="payRemark != null">pay_remark,</if>
|
||
|
|
<if test="contractAttachment != null">contract_attachment,</if>
|
||
|
|
<if test="contractPerson != null">contract_person,</if>
|
||
|
|
<if test="delFlag != null">del_flag,</if>
|
||
|
|
<if test="createBy != null">create_by,</if>
|
||
|
|
<if test="createTime != null">create_time,</if>
|
||
|
|
<if test="updateBy != null">update_by,</if>
|
||
|
|
<if test="updateTime != null">update_time,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="contractCode != null">#{contractCode},</if>
|
||
|
|
<if test="supplierId != null">#{supplierId},</if>
|
||
|
|
<if test="commitStatus != null">#{commitStatus},</if>
|
||
|
|
<if test="contractStatus != null">#{contractStatus},</if>
|
||
|
|
<if test="contractAmount != null">#{contractAmount},</if>
|
||
|
|
<if test="orderGoodsAmount != null">#{orderGoodsAmount},</if>
|
||
|
|
<if test="contractSigningTime != null">#{contractSigningTime},</if>
|
||
|
|
<if test="remark != null">#{remark},</if>
|
||
|
|
<if test="canteenId != null">#{canteenId},</if>
|
||
|
|
<if test="contractTitle != null">#{contractTitle},</if>
|
||
|
|
<if test="contractStartTime != null">#{contractStartTime},</if>
|
||
|
|
<if test="contractEndTime != null">#{contractEndTime},</if>
|
||
|
|
<if test="approveStatus != null">#{approveStatus},</if>
|
||
|
|
<if test="processInstanceId != null">#{processInstanceId},</if>
|
||
|
|
<if test="approveBy != null">#{approveBy},</if>
|
||
|
|
<if test="approveTime != null">#{approveTime},</if>
|
||
|
|
<if test="approveRemark != null">#{approveRemark},</if>
|
||
|
|
<if test="totalNum != null">#{totalNum},</if>
|
||
|
|
<if test="categoryNum != null">#{categoryNum},</if>
|
||
|
|
<if test="payMoneyStyle != null">#{payMoneyStyle},</if>
|
||
|
|
<if test="payMoneyDate != null">#{payMoneyDate},</if>
|
||
|
|
<if test="collectMoneyBank != null">#{collectMoneyBank},</if>
|
||
|
|
<if test="collectMoneyAccount != null">#{collectMoneyAccount},</if>
|
||
|
|
<if test="collectMoneyAccountName != null">#{collectMoneyAccountName},</if>
|
||
|
|
<if test="payRemark != null">#{payRemark},</if>
|
||
|
|
<if test="contractAttachment != null">#{contractAttachment},</if>
|
||
|
|
<if test="contractPerson != null">#{contractPerson},</if>
|
||
|
|
<if test="delFlag != null">#{delFlag},</if>
|
||
|
|
<if test="createBy != null">#{createBy},</if>
|
||
|
|
<if test="createTime != null">#{createTime},</if>
|
||
|
|
<if test="updateBy != null">#{updateBy},</if>
|
||
|
|
<if test="updateTime != null">#{updateTime},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updatePurchaseContract" parameterType="com.bonus.canteen.core.ims.domain.PurchaseContract">
|
||
|
|
update ims_purchase_contract
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="contractCode != null">contract_code = #{contractCode},</if>
|
||
|
|
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
||
|
|
<if test="commitStatus != null">commit_status = #{commitStatus},</if>
|
||
|
|
<if test="contractStatus != null">contract_status = #{contractStatus},</if>
|
||
|
|
<if test="contractAmount != null">contract_amount = #{contractAmount},</if>
|
||
|
|
<if test="orderGoodsAmount != null">order_goods_amount = #{orderGoodsAmount},</if>
|
||
|
|
<if test="contractSigningTime != null">contract_signing_time = #{contractSigningTime},</if>
|
||
|
|
<if test="remark != null">remark = #{remark},</if>
|
||
|
|
<if test="canteenId != null">canteen_id = #{canteenId},</if>
|
||
|
|
<if test="contractTitle != null">contract_title = #{contractTitle},</if>
|
||
|
|
<if test="contractStartTime != null">contract_start_time = #{contractStartTime},</if>
|
||
|
|
<if test="contractEndTime != null">contract_end_time = #{contractEndTime},</if>
|
||
|
|
<if test="approveStatus != null">approve_status = #{approveStatus},</if>
|
||
|
|
<if test="processInstanceId != null">process_instance_id = #{processInstanceId},</if>
|
||
|
|
<if test="approveBy != null">approve_by = #{approveBy},</if>
|
||
|
|
<if test="approveTime != null">approve_time = #{approveTime},</if>
|
||
|
|
<if test="approveRemark != null">approve_remark = #{approveRemark},</if>
|
||
|
|
<if test="totalNum != null">total_num = #{totalNum},</if>
|
||
|
|
<if test="categoryNum != null">category_num = #{categoryNum},</if>
|
||
|
|
<if test="payMoneyStyle != null">pay_money_style = #{payMoneyStyle},</if>
|
||
|
|
<if test="payMoneyDate != null">pay_money_date = #{payMoneyDate},</if>
|
||
|
|
<if test="collectMoneyBank != null">collect_money_bank = #{collectMoneyBank},</if>
|
||
|
|
<if test="collectMoneyAccount != null">collect_money_account = #{collectMoneyAccount},</if>
|
||
|
|
<if test="collectMoneyAccountName != null">collect_money_account_name = #{collectMoneyAccountName},</if>
|
||
|
|
<if test="payRemark != null">pay_remark = #{payRemark},</if>
|
||
|
|
<if test="contractAttachment != null">contract_attachment = #{contractAttachment},</if>
|
||
|
|
<if test="contractPerson != null">contract_person = #{contractPerson},</if>
|
||
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||
|
|
</trim>
|
||
|
|
where contract_id = #{contractId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deletePurchaseContractByContractId" parameterType="Long">
|
||
|
|
delete from ims_purchase_contract where contract_id = #{contractId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deletePurchaseContractByContractIds" parameterType="String">
|
||
|
|
delete from ims_purchase_contract where contract_id in
|
||
|
|
<foreach item="contractId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{contractId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|