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

214 lines
8.7 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.inout.OrderDao">
<select id="listOrder" parameterType="com.glxp.api.admin.req.inout.OrderQueryRequest"
resultType="com.glxp.api.admin.entity.inout.OrderEntity">
SELECT *
FROM io_order where status = 'success'
</select>
<select id="listOrderError" parameterType="com.glxp.api.admin.req.inout.OrderQueryRequest"
resultType="com.glxp.api.admin.entity.inout.OrderEntity">
select * from io_order where `status` <![CDATA[ <> ]]> 'success' ORDER BY actDate DESC
</select>
<select id="listOrderRepeat" parameterType="com.glxp.api.admin.req.inout.OrderQueryRequest"
resultType="com.glxp.api.admin.entity.inout.OrderEntity">
select * from io_order
where corpOrderId in (select corpOrderId from io_order group by corpOrderId HAVING COUNT(corpOrderId)>1 )
ORDER BY actDate DESC
</select>
<insert id="insertOrder" keyProperty="id" parameterType="com.glxp.api.admin.entity.inout.OrderEntity">
insert INTO io_order(id,action,corpOrderId,actDate,fromCorpId,actor,mainAction,
fromCorp,status,remark,exportStatus,fromType,contrastStatus,signStatus,erpFk,stockCheckFk)
values(
#{id},
#{action},
#{corpOrderId},
#{actDate},
#{fromCorpId},
#{actor},
#{mainAction},
#{fromCorp},
#{status},
#{remark},
#{exportStatus},
#{fromType},
#{contrastStatus},
#{signStatus},
#{erpFk},
#{stockCheckFk})
</insert>
<update id="updateOrder" parameterType="com.glxp.api.admin.entity.inout.OrderEntity">
UPDATE io_order
<trim prefix="set" suffixOverrides=",">
<if test="action != null">action=#{action},</if>
<if test="corpOrderId != null">corpOrderId=#{corpOrderId},</if>
<if test="actDate != null">actDate=#{actDate},</if>
<if test="fromCorpId != null">fromCorpId=#{fromCorpId},</if>
<if test="actor != null">actor=#{actor},</if>
<if test="mainAction != null">mainAction=#{mainAction},</if>
<if test="fromCorp != null">fromCorp=#{fromCorp},</if>
<if test="status != null">status=#{status},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="exportStatus != null">exportStatus=#{exportStatus},</if>
<if test="fromType != null">fromType=#{fromType},</if>
<if test="contrastStatus != null">contrastStatus=#{contrastStatus},</if>
<if test="erpFk != null">erpFk=#{erpFk},</if>
<if test="signStatus != null">signStatus=#{signStatus}</if>
<if test="stockCheckFk != null">stockCheckFk=#{stockCheckFk}</if>
</trim>
WHERE id = #{id}
</update>
<select id="listOrderByIds" resultType="com.glxp.api.admin.entity.inout.OrderEntity">
select * from io_order where id in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<delete id="deleteByOrderId" parameterType="Map">
DELETE FROM io_order WHERE id = #{orderId}
</delete>
<delete id="deleteById" parameterType="Map">
DELETE FROM io_order WHERE id = #{id}
</delete>
<insert id="updateUnit" keyProperty="id" parameterType="com.glxp.api.admin.entity.inout.OrderEntity">
UPDATE io_order SET fromCorpId = #{fromCorpId},fromCorp = #{fromCorp} where id = #{id}
</insert>
<update id="updateOrderStatus" parameterType="Map">
UPDATE io_order SET `status` = #{status} where id = #{orderId}
</update>
<update id="updateExportStatus" parameterType="Map">
UPDATE io_order SET `exportStatus` = #{exportStatus} where id = #{orderId}
</update>
<update id="updateContrastStatus" parameterType="Map">
UPDATE io_order SET `contrastStatus` = #{contrastStatus} where id = #{orderId}
</update>
<update id="updateSignStatus" parameterType="Map">
UPDATE io_order SET `signStatus` = #{signStatus} where id = #{orderId}
</update>
<update id="updateRemark" parameterType="Map">
UPDATE io_order SET `remark` = #{remark} where id = #{orderId}
</update>
<select id="filterList" parameterType="com.glxp.api.admin.req.inout.OrderFilterRequest"
resultType="com.glxp.api.admin.entity.inout.OrderEntity">
SELECT * FROM io_order
<where>
<if test="id != '' and id!=null">
and id =#{id}
</if>
<if test="mainAction != '' and mainAction!=null">
and mainAction =#{mainAction}
</if>
<if test="action != '' and action!=null">
and action = #{action}
</if>
<if test="action==null or action == ''">
and `action` <![CDATA[ <> ]]> 'StockCheck'
</if>
<if test="status != '' and status!=null and status!=10">
and status = #{status}
</if>
<if test="status ==10">
and ( status = 1 or status=-1)
</if>
<if test="exportStatus != '' and exportStatus!=null">
and exportStatus = #{exportStatus}
</if>
<if test="signStatus != '' and signStatus!=null">
and signStatus = #{signStatus}
</if>
<if test="contrastStatus != '' and contrastStatus!=null">
and contrastStatus = #{contrastStatus}
</if>
<if test="stockCheckFk != '' and stockCheckFk!=null">
and stockCheckFk = #{stockCheckFk}
</if>
<if test="startTime!=null and startTime!=''">
<![CDATA[ and DATE_FORMAT(actDate, '%Y-%m-%d')>= DATE_FORMAT(#{startTime}, '%Y-%m-%d') ]]>
</if>
<if test="endTime!=null and endTime!=''">
<![CDATA[ and DATE_FORMAT(actDate, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d') ]]>
</if>
</where>
ORDER BY actDate DESC
</select>
<select id="filterNoSort" parameterType="com.glxp.api.admin.req.inout.OrderFilterRequest"
resultType="com.glxp.api.admin.entity.inout.OrderEntity">
SELECT * FROM io_order
<where>
<if test="id != '' and id!=null">
and id =#{id}
</if>
<if test="mainAction != '' and mainAction!=null">
and mainAction =#{mainAction}
</if>
<if test="action != '' and action!=null">
and action = #{action}
</if>
<if test="action==null or action == ''">
and `action` <![CDATA[ <> ]]> 'StockCheck'
</if>
<if test="status != '' and status!=null">
and status = #{status}
</if>
<if test="exportStatus != '' and exportStatus!=null">
and exportStatus = #{exportStatus}
</if>
<if test="signStatus != '' and signStatus!=null">
and signStatus = #{signStatus}
</if>
<if test="contrastStatus != '' and contrastStatus!=null">
and contrastStatus = #{contrastStatus}
</if>
<if test="stockCheckFk != '' and stockCheckFk!=null">
and stockCheckFk = #{stockCheckFk}
</if>
<if test="startTime!=null and startTime!=''">
<![CDATA[ and DATE_FORMAT(actDate, '%Y-%m-%d')>= DATE_FORMAT(#{startTime}, '%Y-%m-%d') ]]>
</if>
<if test="endTime!=null and endTime!=''">
<![CDATA[ and DATE_FORMAT(actDate, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d') ]]>
</if>
</where>
</select>
<select id="findOne" parameterType="com.glxp.api.admin.req.inout.OrderFilterRequest"
resultType="com.glxp.api.admin.entity.inout.OrderEntity">
SELECT * FROM io_order
<where>
<if test="id != '' and id!=null">
and id =#{id}
</if>
<if test="corpOrderId != '' and corpOrderId !=null">
and corpOrderId =#{corpOrderId}
</if>
</where>
limit 1
</select>
<select id="filterListByCode" parameterType="java.util.List"
resultType="com.glxp.api.admin.entity.inout.OrderEntity">
SELECT * FROM io_order WHERE id IN
<foreach collection="warehouseEntityList" item="item" open="(" separator="," close=")">
#{item.orderId}
</foreach>
</select>
</mapper>