| | |
| | | <result column="order_time" property="orderTime" jdbcType="TIMESTAMP"/> |
| | | <result column="receive_time" property="receiveTime" jdbcType="TIMESTAMP"/> |
| | | <result column="review_time" property="reviewTime" jdbcType="TIMESTAMP"/> |
| | | <result column="expected_review_time" property="expectedReviewTime" jdbcType="TIMESTAMP"/> |
| | | <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">id,task_id,client_id,execution_status,status_description,order_no,product_name,shop_name,coupon_code,order_time,receive_time,review_time,create_time,update_time</sql> |
| | | <sql id="Base_Column_List">id,task_id,client_id,execution_status,status_description,order_no,product_name,shop_name,coupon_code,order_time,receive_time,review_time,expected_review_time,create_time,update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">select |
| | | <include refid="Base_Column_List"/> |
| | | from table_order_task_execution_detail where id = #{id,jdbcType=VARCHAR} |
| | |
| | | <if test="query.orderTime!=null">AND order_time = #{query.orderTime}</if> |
| | | <if test="query.receiveTime!=null">AND receive_time = #{query.receiveTime}</if> |
| | | <if test="query.reviewTime!=null">AND review_time = #{query.reviewTime}</if> |
| | | <if test="query.expectedReviewTime!=null">AND expected_review_time = #{query.expectedReviewTime}</if> |
| | | <if test="query.minCreateTime!=null">AND create_time >= #{query.minCreateTime}</if> |
| | | <if test="query.maxCreateTime!=null">AND #{query.maxCreateTime} > create_time</if> |
| | | <if test="query.minUpdateTime!=null">AND update_time >= #{query.minUpdateTime}</if> |
| | |
| | | |
| | | <select id="listCanExcuteTaskDetail" resultMap="BaseResultMap" > |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | d.* |
| | | from `table_order_task_execution_detail` d LEFT JOIN `table_order_task` t ON t.`id`=d.`task_id` |
| | | WHERE |
| | | client_id = #{clientId} |
| | | AND |
| | | ( |
| | | (d.`execution_status`=0 AND d.`create_time` > #{minCreateTime}) |
| | | OR (d.`execution_status`=1 AND UNIX_TIMESTAMP(d.`order_time`) + t.receive_cycle_hours*60*60 < UNIX_TIMESTAMP(NOW())) |
| | | OR (d.`execution_status`=2) |
| | | OR (d.`execution_status`=1 AND UNIX_TIMESTAMP(NOW()) > UNIX_TIMESTAMP(d.`order_time`) + t.receive_cycle_minutes*60) |
| | | OR (d.`execution_status`=2 AND d.expected_review_time is not null) |
| | | ) order by d.create_time limit #{start},#{count} |
| | | </select> |
| | | |
| | |
| | | AND |
| | | ( |
| | | (d.`execution_status`=0 AND d.`create_time` > #{minCreateTime}) |
| | | OR (d.`execution_status`=1 AND UNIX_TIMESTAMP(d.`order_time`) + t.receive_cycle_hours*60*60 < UNIX_TIMESTAMP(NOW())) |
| | | OR (d.`execution_status`=2) |
| | | OR (d.`execution_status`=1 AND UNIX_TIMESTAMP(NOW()) > UNIX_TIMESTAMP(d.`order_time`) + t.receive_cycle_minutes*60) |
| | | OR (d.`execution_status`=2 AND d.expected_review_time is not null) |
| | | ) |
| | | </select> |
| | | |
| | |
| | | <select id="statisticClientIdsCountByStatus" resultMap="ClientCountResultMap"> |
| | | SELECT client_id as clientId,count(*) as count |
| | | FROM table_order_task_execution_detail where |
| | | <foreach collection="statusList" open="" separator=" or " item="status" > |
| | | execution_status=#{status} |
| | | </foreach> |
| | | |
| | | <foreach collection="statusList" open="" separator=" or " item="status" > |
| | | execution_status=#{status} |
| | | </foreach> |
| | | GROUP BY client_id |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.String">delete from table_order_task_execution_detail where id = #{id,jdbcType=VARCHAR}</delete> |
| | | <insert id="insert" parameterType="com.taoke.autopay.entity.js2.OrderTaskExecutionDetail" useGeneratedKeys="true" |
| | | keyProperty="id">insert into table_order_task_execution_detail (id,task_id,client_id,execution_status,status_description,order_no,product_name,shop_name,coupon_code,order_time,receive_time,review_time,create_time,update_time) values (#{id,jdbcType=VARCHAR},#{taskId,jdbcType=BIGINT},#{clientId,jdbcType=BIGINT},#{executionStatus,jdbcType=INTEGER},#{statusDescription,jdbcType=VARCHAR},#{orderNo,jdbcType=VARCHAR},#{productName,jdbcType=VARCHAR},#{shopName,jdbcType=VARCHAR},#{couponCode,jdbcType=VARCHAR},#{orderTime,jdbcType=TIMESTAMP},#{receiveTime,jdbcType=TIMESTAMP},#{reviewTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | keyProperty="id">insert into table_order_task_execution_detail (id,task_id,client_id,execution_status,status_description,order_no,product_name,shop_name,coupon_code,order_time,receive_time,review_time,expected_review_time,create_time,update_time) values (#{id,jdbcType=VARCHAR},#{taskId,jdbcType=BIGINT},#{clientId,jdbcType=BIGINT},#{executionStatus,jdbcType=INTEGER},#{statusDescription,jdbcType=VARCHAR},#{orderNo,jdbcType=VARCHAR},#{productName,jdbcType=VARCHAR},#{shopName,jdbcType=VARCHAR},#{couponCode,jdbcType=VARCHAR},#{orderTime,jdbcType=TIMESTAMP},#{receiveTime,jdbcType=TIMESTAMP},#{reviewTime,jdbcType=TIMESTAMP},#{expectedReviewTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.taoke.autopay.entity.js2.OrderTaskExecutionDetail" useGeneratedKeys="true" |
| | | keyProperty="id">insert into table_order_task_execution_detail |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="clientId != null">client_id,</if> |
| | | <if test="executionStatus != null">execution_status,</if> |
| | | <if test="statusDescription != null">status_description,</if> |
| | | <if test="orderNo != null">order_no,</if> |
| | | <if test="orderNo != null">order_no,</if> |
| | | <if test="productName != null">product_name,</if> |
| | | <if test="shopName != null">shop_name,</if> |
| | | <if test="couponCode != null">coupon_code,</if> |
| | | <if test="orderTime != null">order_time,</if> |
| | | <if test="receiveTime != null">receive_time,</if> |
| | | <if test="reviewTime != null">review_time,</if> |
| | | <if test="expectedReviewTime != null">expected_review_time,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | |
| | | <if test="orderTime != null">#{orderTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="receiveTime != null">#{receiveTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="reviewTime != null">#{reviewTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="expectedReviewTime != null">#{expectedReviewTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.taoke.autopay.entity.js2.OrderTaskExecutionDetail">update table_order_task_execution_detail set task_id = #{taskId,jdbcType=BIGINT},client_id = #{clientId,jdbcType=BIGINT},execution_status = #{executionStatus,jdbcType=INTEGER},status_description = #{statusDescription,jdbcType=VARCHAR},order_no = #{orderNo,jdbcType=VARCHAR},product_name = #{productName,jdbcType=VARCHAR},shop_name = #{shopName,jdbcType=VARCHAR},coupon_code = #{couponCode,jdbcType=VARCHAR},order_time = #{orderTime,jdbcType=TIMESTAMP},receive_time = #{receiveTime,jdbcType=TIMESTAMP},review_time = #{reviewTime,jdbcType=TIMESTAMP},create_time = #{createTime,jdbcType=TIMESTAMP},update_time = #{updateTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=VARCHAR}</update> |
| | | parameterType="com.taoke.autopay.entity.js2.OrderTaskExecutionDetail">update table_order_task_execution_detail set task_id = #{taskId,jdbcType=BIGINT},client_id = #{clientId,jdbcType=BIGINT},execution_status = #{executionStatus,jdbcType=INTEGER},status_description = #{statusDescription,jdbcType=VARCHAR},order_no = #{orderNo,jdbcType=VARCHAR},product_name = #{productName,jdbcType=VARCHAR},shop_name = #{shopName,jdbcType=VARCHAR},coupon_code = #{couponCode,jdbcType=VARCHAR},order_time = #{orderTime,jdbcType=TIMESTAMP},receive_time = #{receiveTime,jdbcType=TIMESTAMP},review_time = #{reviewTime,jdbcType=TIMESTAMP},expected_review_time = #{expectedReviewTime,jdbcType=TIMESTAMP},create_time = #{createTime,jdbcType=TIMESTAMP},update_time = #{updateTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=VARCHAR}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.taoke.autopay.entity.js2.OrderTaskExecutionDetail">update table_order_task_execution_detail |
| | | <set> |
| | | <if test="taskId != null">task_id=#{taskId,jdbcType=BIGINT},</if> |
| | |
| | | <if test="orderTime != null">order_time=#{orderTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="receiveTime != null">receive_time=#{receiveTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="reviewTime != null">review_time=#{reviewTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="expectedReviewTime != null">expected_review_time=#{expectedReviewTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |