123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?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.SparePickDetailMapper">
- <sql id="Base_Column_List">
- sparepickdetail.id,
- sparepickdetail.pick_id,
- sparepickdetail.pick_no,
- sparepickdetail.spare_id,
- sparepickdetail.store_id,
- sparepickdetail.num,
- sparepickdetail.price,
- sparepickdetail.total_price,
- sparepickdetail.created_user_id,
- sparepickdetail.created_user_name,
- sparepickdetail.update_user_id,
- sparepickdetail.update_user_name,
- sparepickdetail.created_time,
- sparepickdetail.update_time
- </sql>
- <sql id="Ref_Column_List">
- sparepickdetail.pick_id,
- sparepickdetail.pick_no,
- sparepickdetail.store_id,
- sparepickdetail.spare_id,
- sparepickdetail.num,
- sparepickdetail.price,
- sparepickdetail.total_price </sql>
- <sql id="List_Condition">
- <if test="id != null and id != ''">
- and sparepickdetail.id = #{id}
- </if>
- <if test="pickId != null and pickId != ''">
- and sparepickdetail.pick_id = #{pickId}
- </if>
- <if test="storeId != null and storeId != ''">
- and sparepickdetail.store_id = #{storeId}
- </if>
- <if test="pickNo != null and pickNo != ''">
- and sparepickdetail.pick_no = #{pickNo}
- </if>
- <if test="spareId != null and spareId != ''">
- and sparepickdetail.spare_id = #{spareId}
- </if>
- <if test="num != null">
- and sparepickdetail.num = #{num}
- </if>
- <if test="createdUserId != null and createdUserId != ''">
- and sparepickdetail.created_user_id = #{createdUserId}
- </if>
- <if test="createdUserName != null and createdUserName != ''">
- and sparepickdetail.created_user_name = #{createdUserName}
- </if>
- <if test="updateUserId != null and updateUserId != ''">
- and sparepickdetail.update_user_id = #{updateUserId}
- </if>
- <if test="updateUserName != null and updateUserName != ''">
- and sparepickdetail.update_user_name = #{updateUserName}
- </if>
- <if test="createdTimeStart != null">
- and sparepickdetail.created_time <![CDATA[>=]]>; #{createdTimeStart}
- </if>
- <if test="createdTimeEnd != null">
- and sparepickdetail.created_time <![CDATA[<=]]> #{createdTimeEnd}
- </if>
- <if test="createdTime != null">
- and sparepickdetail.created_time = #{createdTime}
- </if>
- <if test="updateTimeStart != null">
- and sparepickdetail.update_time <![CDATA[>=]]>; #{updateTimeStart}
- </if>
- <if test="updateTimeEnd != null">
- and sparepickdetail.update_time <![CDATA[<=]]> #{updateTimeEnd}
- </if>
- <if test="updateTime != null">
- and sparepickdetail.update_time = #{updateTime}
- </if>
- <if test="keyword != null and keyword != ''">
- and sparepickdetail.id like concat('%',#{keyword},'%')
- </if>
- <if test="searchStartTime != null">
- and sparepickdetail.created_time <![CDATA[ >= ]]> #{searchStartTime}
- </if>
- <if test="searchEndTime != null">
- and sparepickdetail.created_time <![CDATA[ <= ]]> #{searchEndTime}
- </if>
- </sql>
- <select id="selectList" parameterType="com.platform.dao.dto.store.SparePickDetailDTO"
- resultType="com.platform.dao.vo.query.store.SparePickDetailVO">
- select sparepickdetail.*, store.name storeName, spareinfo.name spareName
- from t_spare_pick_detail as sparepickdetail
- left join t_store store on store.id = sparepickdetail.store_id
- left join t_spare_part_info spareinfo on spareinfo.id = sparepickdetail.spare_id
- <where>
- <include refid="List_Condition"/>
- <if test="useCompany != null and useCompany != ''">
- and store.use_company = #{useCompany}
- </if>
- <if test="useProject != null and useProject != ''">
- and store.use_project = #{useProject}
- </if>
- <if test="userId != null and userId != ''">
- and store.user_id = #{userId}
- </if>
- </where>
- </select>
- <select id="selectReportList" parameterType="com.platform.dao.dto.store.SparePickDetailDTO"
- resultType="com.platform.dao.vo.query.store.SparePickDetailVO">
- select
- sum(sparepickdetail.num) as totalNum,
- spareinfo.name spareName,
- spareinfo.id spareId,
- store.name storeName,
- store.id storeId,
- sparetype.name typeName
- from t_spare_pick_detail as sparepickdetail,t_spare_part_info spareinfo ,t_spare_type sparetype,t_store store
- <where>
- spareinfo.id = sparepickdetail.spare_id
- and spareinfo.type_id = sparetype.id
- and store.id = sparepickdetail.store_id
- <include refid="List_Condition"/>
- </where>
- </select>
- <update id="updateBatch" parameterType="java.util.List">
- <foreach collection="list" item="item" index="index" open="" close="" separator=";">
- update t_spare_pick_detail
- <set>
- num=#{item.num},
- total_price = #{item.totalPrice}
- </set>
- where id = #{item.id}
- </foreach>
- </update>
- </mapper>
|