123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?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.longyanpurchaseorder.LongYanPurchaseOrderMapper">
- <sql id="Base_Column_List">
- menu.id,
- menu.sb_id,
- menu.project_id,
- menu.created_user_id,
- menu.created_user_name,
- menu.created_time,
- menu.update_time,
- menu.update_user_id,
- menu.update_user_name,
- menu.type,
- menu.order_name,
- menu.remark,
- menu.position_no,
- menu.total_num
- </sql>
- <sql id="Ref_Column_List">
- menu.sb_id,
- menu.project_id,
- menu.type,
- menu.order_name,
- menu.remark
- </sql>
- <sql id="List_Condition">
- <if test="id != null and id != ''">
- and menu.id = #{id}
- </if>
- <if test="sbId != null and sbId != ''">
- and menu.sb_id = #{sbId}
- </if>
- <if test="projectId != null and projectId != ''">
- and menu.project_id = #{projectId}
- </if>
- <if test="createdUserId != null and createdUserId != ''">
- and menu.created_user_id = #{createdUserId}
- </if>
- <if test="createdUserName != null and createdUserName != ''">
- and menu.created_user_name = #{createdUserName}
- </if>
- <if test="createdTimeStart != null">
- and menu.created_time <![CDATA[>=]]>; #{createdTimeStart}
- </if>
- <if test="createdTimeEnd != null">
- and menu.created_time <![CDATA[<=]]> #{createdTimeEnd}
- </if>
- <if test="createdTime != null">
- and menu.created_time = #{createdTime}
- </if>
- <if test="updateTimeStart != null">
- and menu.update_time <![CDATA[>=]]>; #{updateTimeStart}
- </if>
- <if test="updateTimeEnd != null">
- and menu.update_time <![CDATA[<=]]> #{updateTimeEnd}
- </if>
- <if test="updateTime != null">
- and menu.update_time = #{updateTime}
- </if>
- <if test="updateUserId != null and updateUserId != ''">
- and menu.update_user_id = #{updateUserId}
- </if>
- <if test="updateUserName != null and updateUserName != ''">
- and menu.update_user_name = #{updateUserName}
- </if>
- <if test="type != null">
- and menu.type = #{type}
- </if>
- <if test="orderName != null and orderName != ''">
- and menu.order_name = #{orderName}
- </if>
- <if test="remark != null and remark != ''">
- and menu.remark = #{remark}
- </if>
- <if test="keyword != null and keyword != ''">
- and menu.id like concat(concat('%',#{keyword}),'%')
- </if>
- <if test="positionNo != null and positionNo != ''">
- and menu.position_no= #{positionNo}
- </if>
- <if test="sbIds!=null and sbIds.size>0">
- and menu.sb_id in
- <foreach collection="sbIds" item="item" close=")" separator="," open="(">
- #{item}
- </foreach>
- </if>
- </sql>
- <select id="selectList" parameterType="com.platform.dao.dto.longyanpurchaseorder.LongYanPurchaseOrderDTO" resultType="com.platform.dao.vo.query.longyanpurchaseorder.LongYanPurchaseOrderVO">
- select menu.*
- from t_long_yan_purchase_order as menu
- <where>
- <include refid="List_Condition" />
- </where>
- </select>
- <select id="getPurchaseReport" resultType="com.platform.dao.vo.report.LongYanPurchaseOrderReportVO"
- parameterType="com.platform.dao.dto.longyanpurchaseorder.LongYanPurchaseOrderDTO">
- select type as purchaseType,count(1) as orderTotalNum,sum(total_num) as spareTotalNum
- from t_long_yan_purchase_order as orders
- <where>
- <if test="startTime!=null">
- and orders.created_time <![CDATA[>=]]> #{startTime}
- </if>
- <if test="endTime!=null">
- and orders.created_time <![CDATA[<=]]> #{endTime}
- </if>
- </where>
- group by type
- </select>
- </mapper>
|