| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?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.fs.sop.mapper.SopOrderLogMapper">
-
- <resultMap type="SopOrderLog" id="SopOrderLogResult">
- <result property="id" column="id" />
- <result property="sopId" column="sop_id" />
- <result property="fsUserId" column="fs_user_id" />
- <result property="isBuy" column="is_buy" />
- <result property="orderSendType" column="order_send_type" />
- <result property="crateTime" column="crate_time" />
- <result property="updateTime" column="update_time" />
- <result property="sendTime" column="send_time" />
- <result property="status" column="status" />
- </resultMap>
- <sql id="selectSopOrderLogVo">
- select id, sop_id, fs_user_id, is_buy, order_send_type, crate_time, update_time, send_time,status from sop_order_log
- </sql>
- <select id="selectSopOrderLogList" parameterType="SopOrderLog" resultMap="SopOrderLogResult">
- <include refid="selectSopOrderLogVo"/>
- <where>
- <if test="sopId != null and sopId != ''"> and sop_id = #{sopId}</if>
- <if test="fsUserId != null "> and fs_user_id = #{fsUserId}</if>
- <if test="isBuy != null "> and is_buy = #{isBuy}</if>
- <if test="orderSendType != null "> and order_send_type = #{orderSendType}</if>
- <if test="crateTime != null "> and crate_time = #{crateTime}</if>
- <if test="sendTime != null "> and send_time = #{sendTime}</if>
- <if test="status != null "> and status = #{status}</if>
- </where>
- </select>
-
- <select id="selectSopOrderLogById" parameterType="Long" resultMap="SopOrderLogResult">
- <include refid="selectSopOrderLogVo"/>
- where id = #{id}
- </select>
- <select id="queryUnsentSOPData" resultType="com.fs.sop.domain.SopOrderLog">
- SELECT sol.id,sol.sop_id,sol.is_buy,sol.order_send_type,sol.status FROM sop_order_log sol WHERE sol.send_time <=NOW() and sol.status=0
- </select>
- <insert id="insertSopOrderLog" parameterType="SopOrderLog" useGeneratedKeys="true" keyProperty="id">
- insert into sop_order_log
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="sopId != null">sop_id,</if>
- <if test="exId != null">ex_id,</if>
- <if test="isBuy != null">is_buy,</if>
- <if test="orderSendType != null">order_send_type,</if>
- <if test="crateTime != null">crate_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="sendTime != null">send_time,</if>
- <if test="status != null">status,</if>
- <if test="companyUserId != null">company_user_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="sopId != null">#{sopId},</if>
- <if test="exId != null">#{exId},</if>
- <if test="isBuy != null">#{isBuy},</if>
- <if test="orderSendType != null">#{orderSendType},</if>
- <if test="crateTime != null">#{crateTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="sendTime != null">#{sendTime},</if>
- <if test="status != null">#{status},</if>
- <if test="companyUserId != null">#{companyUserId},</if>
- </trim>
- </insert>
- <update id="updateSopOrderLog" parameterType="SopOrderLog">
- update sop_order_log
- <trim prefix="SET" suffixOverrides=",">
- <if test="sopId != null">sop_id = #{sopId},</if>
- <if test="fsUserId != null">fs_user_id = #{fsUserId},</if>
- <if test="isBuy != null">is_buy = #{isBuy},</if>
- <if test="orderSendType != null">order_send_type = #{orderSendType},</if>
- <if test="crateTime != null">crate_time = #{crateTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="sendTime != null">send_time = #{sendTime},</if>
- <if test="status != null">status = #{status},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="updateIsSentSOPDataByIds" parameterType="java.util.List">
- UPDATE sop_order_log
- SET status = 1
- WHERE id IN
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </update>
- <delete id="deleteSopOrderLogById" parameterType="Long">
- delete from sop_order_log where id = #{id}
- </delete>
- <delete id="deleteSopOrderLogByIds" parameterType="String">
- delete from sop_order_log where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|