142 lines
7.1 KiB
XML
142 lines
7.1 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.material.purchase.mapper.PurchaseCheckInfoMapper">
|
|
<resultMap type="com.bonus.material.purchase.domain.PurchaseCheckInfo" id="PurchaseCheckInfoResult">
|
|
<result property="id" column="id" />
|
|
<result property="taskId" column="task_id" />
|
|
<result property="code" column="code" />
|
|
<result property="purchaseTime" column="purchase_time" />
|
|
<result property="arrivalTime" column="arrival_time" />
|
|
<result property="purchaser" column="purchaser" />
|
|
<result property="taxRate" column="tax_rate" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createUserName" column="purchaser_name" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="remark" column="remark" />
|
|
<result property="companyId" column="company_id" />
|
|
<result property="taskStatus" column="task_status" />
|
|
</resultMap>
|
|
|
|
<resultMap type="com.bonus.material.purchase.domain.vo.PurchaseCheckFormVo" id="PurchaseCheckFormResult">
|
|
<result property="taskId" column="task_id" />
|
|
<result property="code" column="code" />
|
|
<result property="arrivalDate" column="arrival_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectPurchaseCheckInfoBaseSQL">
|
|
select
|
|
id, task_id, purchase_time, arrival_time, purchaser, tax_rate, create_by,
|
|
create_time, update_by, update_time, remark, company_id
|
|
from
|
|
purchase_check_info
|
|
</sql>
|
|
|
|
<sql id="selectPurchaseCheckInfoJoinSQL">
|
|
select
|
|
pci.id, pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.tax_rate, pci.create_by,
|
|
pci.create_time, pci.update_by, pci.update_time, pci.remark, pci.company_id,
|
|
t.task_status, t.task_type, t.code, su.user_name as create_user_name
|
|
from
|
|
purchase_check_info pci
|
|
left join tm_task t on t.task_id = pci.task_id
|
|
left join sys_user su ON pci.create_by = su.user_id
|
|
</sql>
|
|
|
|
<select id="selectPurchaseCheckInfoList" parameterType="com.bonus.material.purchase.domain.PurchaseCheckInfo" resultMap="PurchaseCheckInfoResult">
|
|
<include refid="selectPurchaseCheckInfoBaseSQL"/>
|
|
<where>
|
|
<if test="taskId != null "> and task_id = #{taskId}</if>
|
|
<if test="purchaseTime != null "> and purchase_time = #{purchaseTime}</if>
|
|
<if test="arrivalTime != null "> and arrival_time = #{arrivalTime}</if>
|
|
<if test="purchaser != null "> and purchaser = #{purchaser}</if>
|
|
<if test="taxRate != null "> and tax_rate = #{taxRate}</if>
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectPurchaseCheckInfoById" parameterType="Long" resultMap="PurchaseCheckInfoResult">
|
|
<include refid="selectPurchaseCheckInfoBaseSQL"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertPurchaseCheckInfo" parameterType="com.bonus.material.purchase.domain.PurchaseCheckInfo" useGeneratedKeys="true" keyProperty="id">
|
|
insert into purchase_check_info
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="taskId != null">task_id,</if>
|
|
<if test="purchaseTime != null">purchase_time,</if>
|
|
<if test="arrivalTime != null">arrival_time,</if>
|
|
<if test="purchaser != null">purchaser,</if>
|
|
<if test="taxRate != null">tax_rate,</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>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="companyId != null">company_id,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="taskId != null">#{taskId},</if>
|
|
<if test="purchaseTime != null">#{purchaseTime},</if>
|
|
<if test="arrivalTime != null">#{arrivalTime},</if>
|
|
<if test="purchaser != null">#{purchaser},</if>
|
|
<if test="taxRate != null">#{taxRate},</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>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="companyId != null">#{companyId},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updatePurchaseCheckInfo" parameterType="com.bonus.material.purchase.domain.PurchaseCheckInfo">
|
|
update purchase_check_info
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="taskId != null">task_id = #{taskId},</if>
|
|
<if test="purchaseTime != null">purchase_time = #{purchaseTime},</if>
|
|
<if test="arrivalTime != null">arrival_time = #{arrivalTime},</if>
|
|
<if test="purchaser != null">purchaser = #{purchaser},</if>
|
|
<if test="taxRate != null">tax_rate = #{taxRate},</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>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="companyId != null">company_id = #{companyId},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deletePurchaseCheckInfoById" parameterType="Long">
|
|
delete from purchase_check_info where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deletePurchaseCheckInfoByIds" parameterType="String">
|
|
delete from purchase_check_info where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectPurchaseCheckInfoJoinList" resultMap="PurchaseCheckInfoResult">
|
|
<include refid="selectPurchaseCheckInfoJoinSQL"/>
|
|
<where>
|
|
<if test="taskId != null "> and pci.task_id = #{taskId}</if>
|
|
<if test="purchaseTime != null "> and pci.purchase_time = #{purchaseTime}</if>
|
|
<if test="arrivalTime != null "> and pci.arrival_time = #{arrivalTime}</if>
|
|
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if>
|
|
<if test="taxRate != null "> and pci.tax_rate = #{taxRate}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectPurchaseCheckFormVoByTaskId" resultMap="PurchaseCheckFormResult">
|
|
<include refid="selectPurchaseCheckInfoJoinSQL"/>
|
|
<where>
|
|
<if test="taskId != null "> and pci.task_id = #{taskId}</if>
|
|
</where>
|
|
</select>
|
|
</mapper> |