123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- <?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.OutStoreDetailMapper">
- <sql id="Base_Column_List">
- outstoredetail.id,
- outstoredetail.out_id,
- outstoredetail.out_no,
- outstoredetail.store_id,
- outstoredetail.spare_id,
- outstoredetail.no,
- outstoredetail.ggxh,
- outstoredetail.real_num,
- outstoredetail.store_num,
- outstoredetail.yy_id,outstoredetail.auto_id,
- outstoredetail.out_flag,
- outstoredetail.c_batch,
- outstoredetail.store_name,
- outstoredetail.store_position,
- outstoredetail.project_no,
- outstoredetail.project_name,
- outstoredetail.project_second_no,
- outstoredetail.project_second_name,
- outstoredetail.spare_name,
- outstoredetail.num,
- outstoredetail.price,
- outstoredetail.total_price,
- outstoredetail.created_user_id,
- outstoredetail.created_user_name,
- outstoredetail.update_user_id,
- outstoredetail.update_user_name,
- outstoredetail.created_time,
- outstoredetail.type,
- outstoredetail.update_time
- </sql>
- <sql id="Ref_Column_List">
- outstoredetail.out_id,
- outstoredetail.out_no,
- outstoredetail.store_id,
- outstoredetail.no,
- outstoredetail.ggxh,
- outstoredetail.type,
- outstoredetail.spare_id,
- outstoredetail.c_batch,
- outstoredetail.real_num,
- outstoredetail.store_num,
- outstoredetail.yy_id,outstoredetail.auto_id,
- outstoredetail.out_flag,
- outstoredetail.store_name,
- outstoredetail.store_position,
- outstoredetail.project_no,
- outstoredetail.project_name,
- outstoredetail.project_second_no,
- outstoredetail.project_second_name,
- outstoredetail.spare_name,
- outstoredetail.num,
- outstoredetail.price,
- outstoredetail.total_price
- </sql>
- <sql id="List_Condition">
- <if test="id != null and id != ''">
- and outstoredetail.id = #{id}
- </if>
- <if test="outId != null and outId != ''">
- and outstoredetail.out_id = #{outId}
- </if>
- <if test="yyId != null and yyId != ''">
- and outstoredetail.yy_id = #{yyId}
- </if>
- <if test="autoId != null and autoId != ''">
- and outstoredetail.auto_id = #{autoId}
- </if>
- <if test="outFlag != null and outFlag != ''">
- and outstoredetail.out_flag = #{outFlag}
- </if>
- <if test="type != null and type != ''">
- and outstoredetail.type = #{type}
- </if>
- <if test="outNo != null and outNo != ''">
- and outstoredetail.out_no = #{outNo}
- </if>
- <if test="storeId != null and storeId != ''">
- and outstoredetail.store_id = #{storeId}
- </if>
- <if test="spareId != null and spareId != ''">
- and outstoredetail.spare_id = #{spareId}
- </if>
- <if test="num != null">
- and outstoredetail.num = #{num}
- </if>
- <if test="createdUserId != null and createdUserId != ''">
- and outstoredetail.created_user_id = #{createdUserId}
- </if>
- <if test="createdUserName != null and createdUserName != ''">
- and outstoredetail.created_user_name = #{createdUserName}
- </if>
- <if test="updateUserId != null and updateUserId != ''">
- and outstoredetail.update_user_id = #{updateUserId}
- </if>
- <if test="updateUserName != null and updateUserName != ''">
- and outstoredetail.update_user_name = #{updateUserName}
- </if>
- <if test="createdTimeStart != null">
- and outstoredetail.created_time <![CDATA[>=]]>; #{createdTimeStart}
- </if>
- <if test="createdTimeEnd != null">
- and outstoredetail.created_time <![CDATA[<=]]> #{createdTimeEnd}
- </if>
- <if test="createdTime != null">
- and outstoredetail.created_time = #{createdTime}
- </if>
- <if test="updateTimeStart != null">
- and outstoredetail.update_time <![CDATA[>=]]>; #{updateTimeStart}
- </if>
- <if test="updateTimeEnd != null">
- and outstoredetail.update_time <![CDATA[<=]]> #{updateTimeEnd}
- </if>
- <if test="updateTime != null">
- and outstoredetail.update_time = #{updateTime}
- </if>
- <if test="keyword != null and keyword != ''">
- and outstoredetail.id like concat('%',#{keyword},'%')
- </if>
- <if test="searchStartTime != null">
- and outstoredetail.created_time <![CDATA[ >= ]]> #{searchStartTime}
- </if>
- <if test="searchEndTime != null">
- and outstoredetail.created_time <![CDATA[ <= ]]> #{searchEndTime}
- </if>
- </sql>
- <select id="selectList" parameterType="com.platform.dao.dto.store.OutStoreDetailDTO"
- resultType="com.platform.dao.vo.query.store.OutStoreDetailVO">
- select outstoredetail.*, store.name storeName, spareinfo.name spareName, spareinfo.no spareNo
- from t_out_store_detail as outstoredetail
- left join t_store store on store.id = outstoredetail.store_id
- left join t_spare_part_info spareinfo on spareinfo.id = outstoredetail.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>
- <if test="spareNo != null and spareNo != ''">
- and spareinfo.no = #{spareNo}
- </if>
- </where>
- </select>
- <select id="selectReportList" parameterType="com.platform.dao.dto.store.OutStoreDetailDTO"
- resultType="com.platform.dao.vo.query.store.OutStoreDetailVO">
- select outstoredetail.*,
- sum(outstoredetail.real_num) as totalNum
- /*spareinfo.name spareName,
- spareinfo.id spareId,
- spareinfo.no spareNo,
- store.name storeName,
- store.id storeId,
- sparetype.name typeName*/
- from t_out_store_detail as outstoredetail
- <where>
- /*spareinfo.id = outstoredetail.spare_id
- and spareinfo.type_id = sparetype.id
- and store.id = outstoredetail.store_id*/
- <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>
- <if test="spareNo != null and spareNo != ''">
- and spareinfo.no = #{spareNo}
- </if>-->
- </where>
- </select>
- <update id="updateBatch" parameterType="java.util.List">
- <foreach collection="list" item="item" index="index" open="" close="" separator=";">
- update t_out_store_detail
- <set>
- num=#{item.num},
- total_price = #{item.totalPrice}
- </set>
- where id = #{item.id}
- </foreach>
- </update>
- <select id="getCurrentlyList" parameterType="com.platform.dao.dto.store.OutStoreFormDTO"
- resultType="com.platform.dao.vo.query.store.OutStoreDetailVO"
- >
- select * from t_out_store_detail
- left join
- t_out_store_form
- on
- t_out_store_form.id = t_out_store_detail.out_id
- left join
- t_store
- on t_out_store_form.store_id=t_store.id
- <where>
- <if test="userId!=null">
- and user_id=#{userId}
- </if>
- <if test="searchStartTime != null">
- and t_out_store_detail.created_time <![CDATA[ > ]]> #{searchStartTime}
- </if>
- <if test="searchEndTime != null">
- and t_out_store_detail.created_time <![CDATA[ < ]]> #{searchEndTime}
- </if>
- <if test="status != null">
- and status = #{status}
- </if>
- </where>
- </select>
- </mapper>
|