123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <?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.platform.dao.mapper.store.StoreCheckJobMapper">
- <sql id="Base_Column_List">
- checkjob.id,
- checkjob.plan_id,
- checkjob.start_time,
- checkjob.end_time,
- checkjob.check_num,
- checkjob.real_num,
- checkjob.spare_id,
- checkjob.profit_price,
- checkjob.price,
- checkjob.profit_num,
- checkjob.store_id,
- checkjob.spare_store_id,
- checkjob.actual_start_time,
- checkjob.actual_end_time,
- checkjob.profit,
- checkjob.status,
- checkjob.check_user_id,
- checkjob.created_user_id,
- checkjob.update_user_id,
- checkjob.created_user_name,
- checkjob.update_user_name,
- checkjob.created_time,
- checkjob.update_time
- </sql>
- <sql id="Ref_Column_List">
- checkjob.id,
- checkjob.plan_id,
- checkjob.start_time,
- checkjob.end_time,
- checkjob.check_num,
- checkjob.real_num,
- checkjob.profit_price,
- checkjob.price,
- checkjob.profit_num,
- checkjob.spare_id,
- checkjob.store_id,
- checkjob.spare_store_id,
- checkjob.actual_start_time,
- checkjob.actual_end_time,
- checkjob.profit,checkjob.status
- </sql>
- <sql id="List_Condition">
- <if test="id != null and id != ''">
- and checkjob.id = #{id}
- </if>
- <if test="planId != null and planId != ''">
- and checkjob.plan_id = #{planId}
- </if>
- <if test="spareId != null and spareId != ''">
- and checkjob.spare_id = #{spareId}
- </if>
- <if test="storeId != null and storeId != ''">
- and checkjob.store_id = #{storeId}
- </if>
- <if test="spareStoreId != null and spareStoreId != ''">
- and checkjob.spare_store_id = #{spareStoreId}
- </if>
- <if test="remark != null and remark != ''">
- and checkjob.remark = #{remark}
- </if>
- <if test="feedback != null and feedback != ''">
- and checkjob.feedback = #{feedback}
- </if>
- <if test="startTime != null">
- and checkjob.start_time = #{startTime}
- </if>
- <if test="endTimeStart != null">
- and checkjob.end_time <![CDATA[>=]]>; #{endTimeStart}
- </if>
- <if test="endTimeEnd != null">
- and checkjob.end_time <![CDATA[<=]]> #{endTimeEnd}
- </if>
- <if test="endTime != null">
- and checkjob.end_time = #{endTime}
- </if>
- <if test="status != null">
- and checkjob.status = #{status}
- </if>
- <if test="createdUserId != null and createdUserId != ''">
- and checkjob.created_user_id = #{createdUserId}
- </if>
- <if test="updateUserId != null and updateUserId != ''">
- and checkjob.update_user_id = #{updateUserId}
- </if>
- <if test="createdTime != null">
- and checkjob.created_time = #{createdTime}
- </if>
- <if test="updateTime != null">
- and checkjob.update_time = #{updateTime}
- </if>
- <if test="checkUserId != null">
- and checkjob.check_user_id = #{checkUserId}
- </if>
- <if test="keyword != null and keyword != ''">
- and checkjob.id like concat('%',#{keyword},'%')
- </if>
- </sql>
- <select id="selectList" parameterType="com.platform.dao.dto.store.StoreCheckJobDTO" resultType="com.platform.dao.vo.query.store.StoreCheckJobVO">
- select checkjob.*,
- u.real_name as checkUserName,
- plan.name as planName,
- spare.name as spareName,
- spare.ggxh as ggxh,
- spare.init_no as initNo,
- spare.unit,
- spare.no as no,
- store.name as storeName
- from t_store_check_job as checkjob
- left join t_store_check_plan plan on checkjob.plan_id = plan.id
- left join t_store store on checkjob.store_id = store.id
- left join t_spare_part_info spare on checkjob.spare_id = spare.id
- left join t_sys_user u on checkjob.check_user_id = u.user_id
- <where>
- <include refid="List_Condition"/>
- </where>
- </select>
- <select id="selectDetail" resultType="com.platform.dao.vo.query.store.StoreCheckJobVO">
- select checkjob.*,
- u.real_name as checkUserName,
- plan.name as planName,
- spare.name as spareName,
- store.name as storeName
- from t_store_check_job as checkjob
- left join t_store_check_plan plan on checkjob.plan_id = plan.id
- left join t_store store on checkjob.store_id = store.id
- left join t_spare_part_info spare on checkjob.spare_id = spare.id
- left join t_sys_user u on checkjob.check_user_id = u.user_id
- where checkjob.id = #{id}
- </select>
- <select id="selectJobList" resultType="com.platform.dao.vo.query.store.StoreCheckJobVO">
- select checkjob.*, u.real_name as checkUserName
- from t_store_check_job as checkjob
- left join t_sys_user u on checkjob.check_user_id = u.user_id
- where checkjob.plan_id = #{planId}
- </select>
- <update id="updateStatus" parameterType="com.platform.dao.dto.store.StoreCheckJobDTO">
- update t_store_check_job
- set status = #{status}
- where plan_id = #{planId}
- </update>
- <select id="getNumByDTO" parameterType="com.platform.dao.dto.store.StoreCheckJobDTO"
- resultType="BigDecimal">
- select count(1) from t_store_check_job job left join t_store store on
- job.store_id=store.id
- <where>
- <if test="userId!=null and userId!=''">
- and store.user_id=#{userId}
- </if>
- </where>
- </select>
- </mapper>
|