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.
spms-java/api-admin/src/main/resources/mybatis/mapper/inout/StockOrderDao.xml

145 lines
5.2 KiB
XML

4 years ago
<?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.sale.admin.dao.inout.StockOrderDao">
<select id="listStockOrder" parameterType="com.glxp.sale.admin.req.inout.StockOrderQueryRequest"
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
SELECT *
FROM stock_order
where status = 'success'
</select>
<select id="listStockOrderNoDealWith" parameterType="com.glxp.sale.admin.req.inout.StockOrderQueryRequest"
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
select *
from stock_order
where `status` = '101'
ORDER BY id DESC
</select>
<insert id="insertStockOrder" useGeneratedKeys="true" keyProperty="id" parameterType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
insert INTO stock_order(id, billNo, billdate, corpId, corpName, billType, billFlag,
thirdSysFk, status, statusInfo, type, sourceType, status2)
values (
#{id},
#{billNo},
#{billdate},
#{corpId},
#{corpName},
#{billType},
#{billFlag},
#{thirdSysFk},
#{status},
#{statusInfo},
#{type},
#{sourceType},
#{status2}
)
</insert>
<update id="updateById" parameterType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
UPDATE stock_order
<set>
<if test="billNo != null">billNo=#{billNo},</if>
<if test="billdate != null">billdate=#{billdate},</if>
<if test="corpId != null">corpId=#{corpId},</if>
<if test="corpName != null">corpName=#{corpName},</if>
<if test="billType != null">billType=#{billType},</if>
<if test="billFlag != null">billFlag=#{billFlag},</if>
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
<if test="status != null">status=#{status},</if>
<if test="statusInfo != null">statusInfo=#{statusInfo},</if>
<if test="type != null">type=#{type},</if>
<if test="sourceType != null">sourceType=#{sourceType},</if>
<if test="status2 != null">status2=#{status2},</if>
</set>
WHERE id = #{id}
</update>
<delete id="deleteByOrderId" parameterType="Map">
DELETE
FROM stock_order
WHERE id = #{orderId}
</delete>
<delete id="deleteById" parameterType="Map">
DELETE
FROM stock_order
WHERE id = #{id}
</delete>
<update id="updateByStatus" parameterType="Map">
UPDATE stock_order
SET `status` = #{status}
where id = #{orderId}
</update>
<select id="filterListOr" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
SELECT * FROM stock_order
<where>
<if test="id != '' and id!=null">
and id =#{id}
</if>
<if test="billNo != '' and billNo!=null">
and billNo =#{billNo}
</if>
<if test="billdate != '' and billdate!=null">
and billdate = #{billdate}
</if>
<if test="corpId != '' and corpId!=null">
and corpId = #{corpId}
</if>
<if test="corpName != '' and corpName!=null">
and corpName = #{corpName}
</if>
<if test="billType != '' and billType!=null">
and billType = #{billType}
</if>
<if test="billFlag != '' and billFlag!=null">
and billFlag = #{billFlag}
</if>
<if test="thirdSysFk != '' and thirdSysFk!=null">
and thirdSysFk = #{thirdSysFk}
</if>
<if test="status != '' and status!=null">
and status = #{status}
</if>
<if test="statusInfo != '' and statusInfo!=null">
and statusInfo = #{statusInfo}
</if>
<if test="type != '' and type!=null">
and type = #{type}
</if>
<if test="sourceType != '' and sourceType!=null">
and sourceType = #{sourceType}
</if>
<if test="status2 != '' and status2!=null">
and status2 = #{status2}
</if>
</where>
ORDER BY id DESC
</select>
<select id="findOne" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
SELECT * FROM stock_order
<where>
<if test="id != '' and id!=null">
and id =#{id}
</if>
<if test="corpId != '' and corpId !=null">
and corpId =#{corpId}
</if>
<if test="billNo != '' and billNo !=null">
and billNo =#{billNo}
</if>
</where>
limit 1
</select>
</mapper>