You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
3.4 KiB
XML
98 lines
3.4 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.glxp.api.admin.dao.purchase.PurApplyDetailDao">
|
|
|
|
<select id="queryPageList" parameterType="com.glxp.api.admin.req.purchase.PurApplyDetailRequest"
|
|
resultType="com.glxp.api.admin.entity.purchase.PurApplyDetailEntity">
|
|
select *
|
|
FROM pur_apply_detail
|
|
<where>
|
|
<if test="orderIdFk != '' and orderIdFk != null">
|
|
AND orderIdFk = #{orderIdFk}
|
|
</if>
|
|
<if test="productId != null">
|
|
AND productId = #{productId}
|
|
</if>
|
|
<if test="supId != '' and supId != null">
|
|
AND supId = #{supId}
|
|
</if>
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="joinQueryList" parameterType="com.glxp.api.admin.req.purchase.PurApplyDetailRequest"
|
|
resultType="com.glxp.api.admin.entity.business.StockOrderDetailEntity">
|
|
select
|
|
pur_apply_detail.*,
|
|
basic_products.ggxh spec,basic_udirel.measname,basic_udirel.manufactory,basic_products.ylqxzcrbarmc,basic_corp.`name` supName
|
|
FROM pur_apply_detail
|
|
INNER JOIN basic_udirel on pur_apply_detail.productId = basic_udirel.id
|
|
INNER JOIN basic_products on basic_udirel.uuid = basic_products.uuid
|
|
inner join basic_corp on pur_apply_detail.supId =basic_corp.erpId
|
|
<where>
|
|
<if test="orderIdFk != '' and orderIdFk != null">
|
|
AND orderIdFk = #{orderIdFk}
|
|
</if>
|
|
<if test="productId != null">
|
|
AND productId = #{productId}
|
|
</if>
|
|
<if test="supId != '' and supId != null">
|
|
AND supId = #{supId}
|
|
</if>
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<insert id="insert" keyProperty="id"
|
|
parameterType="com.glxp.api.admin.entity.purchase.PurApplyDetailEntity">
|
|
replace
|
|
INTO pur_apply_detail
|
|
(
|
|
orderIdFk,productId,productName,`count`,supId,zczbhhzbapzbh
|
|
)
|
|
values (
|
|
#{orderIdFk},
|
|
#{productId},
|
|
#{productName},
|
|
#{count},
|
|
#{supId},#{zczbhhzbapzbh}
|
|
)
|
|
</insert>
|
|
|
|
|
|
<delete id="deleteByIds" parameterType="java.util.List">
|
|
DELETE FROM pur_apply_detail WHERE id in
|
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteById" parameterType="Map">
|
|
DELETE
|
|
FROM pur_apply_detail
|
|
WHERE id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteByOrderId" parameterType="Map">
|
|
DELETE
|
|
FROM pur_apply_detail
|
|
WHERE orderIdFk = #{orderIdFk}
|
|
</delete>
|
|
|
|
|
|
<update id="update" parameterType="com.glxp.api.admin.entity.purchase.PurApplyDetailEntity">
|
|
UPDATE pur_apply_detail
|
|
<trim prefix="set" suffixOverrides=",">
|
|
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
|
|
<if test="productId != null">productId=#{productId},</if>
|
|
<if test="productName != null">productName=#{productName},</if>
|
|
<if test="count != null">`count`=#{count},</if>
|
|
<if test="supId != null">supId=#{supId},</if>
|
|
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
|
|
</trim>
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
</mapper> |