| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163 | 
							- <?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.gree.mall.manager.commonmapper.CommonMapper">
 
-     <select id="queryChargingStandrdList" resultType="com.gree.mall.manager.bean.charging.ChargingStandardBean">
 
-         select
 
-             a.* ,
 
-             b.name as 'typeName',
 
-           c.brand_name,
 
-             (select name from goods_category where type=2 and category_id = a.one_category_id) as 'oneCategoryName',
 
-             (select name from goods_category where type=2 and category_id = a.two_category_id) as 'twoCategoryName'
 
-         from charging_standard a
 
-         left join charging_standard_type b on a.charging_standard_type_id = b.id
 
-         join brand c on c.id = a.brand_id
 
-         where 1=1
 
-         <if test="companyWechatId != null and companyWechatId !=''">
 
-             and a.company_wechat_id=#{companyWechatId}
 
-         </if>
 
-         <if test="id != null and id !=''">
 
-             and a.id = #{id}
 
-         </if>
 
-         <if test="type != null">
 
-             and a.type = #{type}
 
-         </if>
 
-         <if test="status != null">
 
-             and a.status=#{status}
 
-         </if>
 
-         <if test="brandId != null and brandId != ''">
 
-             and a.brand_id=#{brandId}
 
-         </if>
 
-         <if test="oneCategoryId != null and oneCategoryId !=''">
 
-             and a.one_category_id = #{oneCategoryId}
 
-         </if>
 
-         <if test="twoCategoryId != null and twoCategoryId !=''">
 
-             and a.two_category_id = #{twoCategoryId}
 
-         </if>
 
-         <if test="content1 != null and content1 !=''">
 
-             and a.content1 like concat('%',#{content1},'%')
 
-         </if>
 
-         order by a.create_time desc
 
-     </select>
 
-     <select id="chargingStandardTypeList" resultType="com.gree.mall.manager.bean.listvo.ChargingStandardTypeVO">
 
-         select
 
-           ${ex.selected}
 
-         from charging_standard_type a
 
-           ${ex.query}
 
-         ORDER BY a.create_time DESC
 
-     </select>
 
-     <select id="chargingStandardList" resultType="com.gree.mall.manager.bean.listvo.ChargingStandardVO">
 
-         select
 
-             ${ex.selected},
 
-             b.name 'chargingStandardTypeName',
 
-             c.name 'oneCategoryName',
 
-             d.name 'twoCategoryName'
 
-         from charging_standard a
 
-         join charging_standard_type b on a.charging_standard_type_id=b.id
 
-         left join goods_category c on c.category_id = a.one_category_id
 
-         left join goods_category d on d.category_id = a.two_category_id
 
-         join brand e on e.id = a.brand_id
 
-           ${ex.query}
 
-         and a.type = 1
 
-         ORDER BY a.create_time DESC
 
-     </select>
 
-     <select id="chargingStandardList2" resultType="com.gree.mall.manager.bean.listvo.ChargingStandard2VO">
 
-         select
 
-             ${ex.selected},
 
-             c.name 'oneCategoryName',
 
-             d.name 'twoCategoryName'
 
-         from charging_standard a
 
-         join brand b on b.id = a.brand_id
 
-         left join goods_category c on c.category_id = a.one_category_id
 
-         left join goods_category d on d.category_id = a.two_category_id
 
-           ${ex.query}
 
-         and a.type = 2
 
-         ORDER BY a.create_time DESC
 
-     </select>
 
-     <select id="userList" resultType="com.gree.mall.manager.bean.listvo.UserVO">
 
-         select
 
-         ${ex.selected}
 
-         <!--
 
-         b.websit_id,
 
-         c.name as 'websit_name',
 
-         d.nick_name as 'slaveWorkerName'
 
-         -->
 
-         from user a
 
-         <!--
 
-            join websit_user b on a.user_id = b.user_id
 
-            join admin_websit c on c.websit_id = b.websit_id
 
-            left join user d on b.slave_worker_id = d.user_id
 
-            -->
 
-         ${ex.query}
 
-        <!--
 
-        <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
 
-            AND c.websit_id IN
 
-            <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                #{item}
 
-            </foreach>
 
-        </if>
 
-        -->
 
-         <if test="isOK != null and isOK == true">
 
-             AND a.worker_number IS NOT NULL
 
-         </if>
 
-         <if test="ex.isGroupByWorkerId != null and ex.isGroupByWorkerId == true">
 
-             GROUP BY a.worker_number
 
-         </if>
 
-         ORDER BY <!-- FIELD(b.examine_status,'WAIT','OK','FAIL'), --> a.create_time DESC
 
-     </select>
 
-     <select id="userServiceList" resultType="com.gree.mall.manager.bean.listvo.User2VO">
 
-         select
 
-         ${ex.selected}
 
-         from user a
 
-         ${ex.query}
 
-         ORDER BY FIELD(a.examine_status,'WAIT','OK','FAIL'),a.create_time DESC
 
-     </select>
 
-     <select id="userCustomerList" resultType="com.gree.mall.manager.bean.listvo.UserCustomerVO">
 
-         select
 
-           ${ex.selected},
 
-           b.nick_name as 'serviceName',
 
-           b.mobile as 'serviceMobile',
 
-           c.nick_name as 'firstServiceName',
 
-           c.mobile  as 'firstServiceMobile'
 
-         from user a
 
-         left join user b on a.service_id = b.user_id
 
-         left join user c on a.first_service_id = c.user_id
 
-           ${ex.query}
 
-         and a.type='GENERAL'
 
-         ORDER BY a.create_time DESC
 
-     </select>
 
-     <select id="amityList" resultType="com.gree.mall.manager.bean.common.AmityUrlVO">
 
-         select
 
-         a.*
 
-         from amity_url a
 
-         ${ex.query}
 
-         AND a.del = 0
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             order by a.create_time desc
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="orderSmallTypeList" resultType="com.gree.mall.manager.bean.listvo.workorder.OrderSmallTypeVO">
 
-         select
 
-           ${ex.selected}
 
-         from order_small_type a
 
-           ${ex.query}
 
-         order by a.id desc
 
-     </select>
 
-     <select id="orderBaseList" resultType="com.gree.mall.manager.bean.listvo.workorder.OrderBaseVO">
 
-         select
 
-           ${ex.selected}
 
-         from pg_order_base a
 
-           ${ex.query}
 
-           <if test="ex.orderSmallType != null and ex.orderSmallType !=''">
 
-               and a.order_small_type = #{ex.orderSmallType}
 
-           </if>
 
-         <if test="ex.orderStatus != null and ex.orderStatus.key !='YCD'.toString() and ex.orderStatus.key !='DYY'.toString() and ex.orderStatus.key !='PJSQZ'.toString() and ex.orderStatus.key !='PJYDH'.toString() and ex.orderStatus.key !='PJYQX'.toString()">
 
-             and a.order_status = #{ex.orderStatus.key}
 
-         </if>
 
-         <if test="ex.orderStatus != null and ex.orderStatus.key =='YCD'.toString()">
 
-             and a.is_exception =1
 
-         </if>
 
-         <if test="ex.orderStatus != null and ex.orderStatus.key =='DYY'.toString()">
 
-             and a.appointment_time is null and a.order_status in('DYY','DSHPG','DWDPG','DJD')
 
-         </if>
 
-         <if test="ex.partsApplyStatus != null and ex.partsApplyStatus =='PJSQZ'.toString()">
 
-             and a.id in(select order_base_id from websit_parts_apply where `status` = 'ING')
 
-         </if>
 
-         <if test="ex.partsApplyStatus != null and ex.partsApplyStatus =='PJYDH'.toString()">
 
-             and a.id in(select order_base_id from websit_parts_apply where `status` = 'END')
 
-         </if>
 
-         <if test="ex.partsApplyStatus != null and ex.partsApplyStatus =='PJYQX'.toString()">
 
-             and a.id in(select order_base_id from websit_parts_apply where `status` = 'CANCEL')
 
-         </if>
 
-         <if test="ex.isYb != null and ex.isYb == true">
 
-             and a.pg_incre_item_id !=''
 
-         </if>
 
-         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0 and adminUserType != null and adminUserType == 0">
 
-             AND (
 
-                 a.websit_id IN
 
-                 <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                     #{item}
 
-                 </foreach>
 
-                 or
 
-                 a.create_websit_id IN
 
-                 <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                     #{item}
 
-                 </foreach>
 
-                 <if test="companyWechatId != null and companyWechatId != ''">
 
-                     or a.company_wechat_id  =  #{companyWechatId}
 
-                 </if>
 
-             )
 
-         </if>
 
-         order by a.create_time desc,id desc
 
-     </select>
 
-     <select id="examineProjectConfigList"
 
-             resultType="com.gree.mall.manager.bean.workorder.ExamineProjectConfigVO">
 
-         SELECT
 
-             ${ex.selected}
 
-         FROM pg_examine_project_config a
 
-             ${ex.query}
 
-         AND a.del = 0
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-     </select>
 
-     <select id="examineProjectList" resultType="com.gree.mall.manager.bean.workorder.ExamineProjectVO">
 
-         SELECT
 
-             ${ex.selected}
 
-         FROM pg_examine_project a
 
-             ${ex.query}
 
-         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0 and adminUserType != null and adminUserType == 0">
 
-             AND
 
-             a.websit_id IN
 
-             <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-         </if>
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-     </select>
 
-     <select id="orderBaseAppraiseList" resultType="com.gree.mall.manager.bean.listvo.workorder.OrderBaseAppraiseVO">
 
-         select
 
-           ${ex.selected}
 
-         from pg_order_base a
 
-         ${ex.query}
 
-         and a.appraise_status != 'N'
 
-         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
 
-             AND (
 
-                 a.websit_id IN
 
-                 <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                     #{item}
 
-                 </foreach>
 
-             )
 
-         </if>
 
-         order by a.id desc
 
-     </select>
 
-     <select id="installNormList" resultType="com.gree.mall.manager.bean.workorder.InstallSettleNormVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM pg_settle_norm a
 
-         ${ex.query}
 
-         AND a.del = 0
 
-         AND a.settle_norm_type = 'INSTALL'
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.type, a.parent_category_id, a.category_id
 
-         </if>
 
-     </select>
 
-     <select id="repairNormList" resultType="com.gree.mall.manager.bean.workorder.RepairSettleNormVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM pg_settle_norm a
 
-         ${ex.query}
 
-         AND a.del = 0
 
-         AND a.settle_norm_type = 'REPAIR'
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.type, a.parent_category_id, a.category_id, a.label
 
-         </if>
 
-     </select>
 
-     <select id="otherNormList" resultType="com.gree.mall.manager.bean.workorder.OtherSettleNormVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM pg_settle_norm a
 
-         ${ex.query}
 
-         AND a.del = 0
 
-         AND a.settle_norm_type = 'OTHER'
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.type, a.label
 
-         </if>
 
-     </select>
 
-     <select id="settleOrderList" resultType="com.gree.mall.manager.bean.workorder.SettleOrderVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM pg_settle_order a
 
-         ${ex.query}
 
-         <if test="websitIds != null and websitIds.size > 0">
 
-             AND (
 
-             a.websit_id IN
 
-             <foreach item="item" index="index" collection="websitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-             )
 
-         </if>
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="settlePoolList" resultType="com.gree.mall.manager.bean.workorder.SettlePoolVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM pg_settle_pool a
 
-         ${ex.query}
 
-         <if test="websitIds != null and websitIds.size > 0">
 
-             AND (
 
-             a.websit_id IN
 
-             <foreach item="item" index="index" collection="websitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-             )
 
-         </if>
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.pool_create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="poolDetailList" resultType="com.gree.mall.manager.bean.workorder.SettlePoolWorkerVO">
 
-         SELECT
 
-             a.*,
 
-             b.id AS order_id,
 
-             b.order_base_id,
 
-             b.customer_name,
 
-             b.customer_mobile,
 
-             b.customer_address,
 
-             b.order_status,
 
-             b.order_create_time,
 
-             b.worker_end_time,
 
-             b.order_type,
 
-             b.order_type_text,
 
-             b.order_small_type,
 
-             b.order_small_type_text,
 
-             b.brand_id,
 
-             b.brand,
 
-             b.order_source,
 
-             b.order_channel,
 
-             b.parent_category_id,
 
-             b.parent_category_name,
 
-             b.category_id,
 
-             b.category_name,
 
-             b.goods_name,
 
-             b.order_num,
 
-             b.settle_order_type,
 
-             b.install_id,
 
-             b.install_label,
 
-             b.install_norm_amount,
 
-             b.repair_id,
 
-             b.repair_label,
 
-             b.repair_amount,
 
-             b.repair_rate,
 
-             b.repair_settle_amount,
 
-             b.other_id,
 
-             b.other_type,
 
-             b.other_label,
 
-             b.other_price,
 
-             b.examine_project_id,
 
-             b.examine_project,
 
-             b.examine_type,
 
-             b.settle_num,
 
-             b.settle_amount
 
-         FROM
 
-             pg_settle_pool_worker a LEFT JOIN pg_settle_order b ON a.pool_id = b.pool_id AND a.worker_id = b.worker_id
 
-         WHERE
 
-             a.pool_id = #{id}
 
-         <if test="workerName!=null and workerName!=''">
 
-             AND a.worker_name LIKE CONCAT('%',#{workerName},'%')
 
-         </if>
 
-         <if test="mobile!=null and mobile!=''">
 
-             AND a.worker_mobile LIKE CONCAT('%',#{mobile},'%')
 
-         </if>
 
-         <if test="idcard!=null and idcard!=''">
 
-             AND a.worker_idcard LIKE CONCAT('%',#{idcard},'%')
 
-         </if>
 
-         <if test="orderBaseId!=null and orderBaseId!=''">
 
-             AND b.order_base_id LIKE CONCAT('%',#{orderBaseId},'%')
 
-         </if>
 
-         <if test="customerName!=null and customerName!=''">
 
-             AND b.customer_name LIKE CONCAT('%',#{customerName},'%')
 
-         </if>
 
-         <if test="customerMobile!=null and customerMobile!=''">
 
-             AND b.customer_mobile LIKE CONCAT('%',#{customerMobile},'%')
 
-         </if>
 
-         <if test="orderSmallType!=null and orderSmallType!=''">
 
-             AND b.order_small_type = #{orderSmallType}
 
-         </if>
 
-         <if test="settleOrderType!=null and settleOrderType!=''">
 
-             AND b.settle_order_type = #{settleOrderType}
 
-         </if>
 
-     </select>
 
-     <select id="userWaitList" resultType="com.gree.mall.manager.bean.listvo.workorder.UserWaitVO">
 
-         SELECT
 
-           ${ex.selected}
 
-         FROM user_wait a
 
-         ${ex.query}
 
-         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
 
-             AND (
 
-             a.websit_id IN
 
-             <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-             )
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="increOrderSettleList" resultType="com.gree.mall.manager.bean.workorder.IncreOrderVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM pg_incre_order a
 
-         ${ex.query}
 
-         <if test="isSettleList != null and isSettleList == true">
 
-             AND a.settle_status IN ('OVER', 'EXCEPTION')
 
-         </if>
 
-         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
 
-             AND (
 
-             a.websit_id IN
 
-             <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-             )
 
-         </if>
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="websitOrderSettleCountList"
 
-             resultType="com.gree.mall.manager.bean.workorder.WebsitOrderSettleCountVO">
 
-         SELECT
 
-             a.company_wechat_id,
 
-             a.company_wechat_name,
 
-             a.websit_id,
 
-             a.websit_name,
 
-             COUNT(a.id) AS order_num,
 
-             SUM(a.amount) AS order_amount,
 
-             SUM(a.websit_amount) AS websit_amount
 
-         FROM pg_incre_order a
 
-         ${ex.query}
 
-         AND a.settle_status IN ('OVER', 'EXCEPTION')
 
-         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
 
-             AND (
 
-             a.websit_id IN
 
-             <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-             )
 
-         </if>
 
-         GROUP BY
 
-         a.company_wechat_id, a.websit_id
 
-     </select>
 
-     <select id="orderBaseList2" resultType="com.gree.mall.manager.bean.listvo.workorder.OrderBase2VO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM pg_order_base a
 
-             JOIN pg_order_product b ON a.id = b.order_base_id
 
-             JOIN pg_order_settle_norm c ON b.id = c.pg_order_product_id AND c.settle_norm_type IN ('INSTALL','REPAIR')
 
-         ${ex.query}
 
-         <if test="ex.orderSmallType != null and ex.orderSmallType !=''">
 
-             AND a.order_small_type = #{ex.orderSmallType}
 
-         </if>
 
-         <if test="ex.orderStatus != null and ex.orderStatus.key !='YCD'.toString() and ex.orderStatus.key !='DYY'.toString()">
 
-             AND a.order_status = #{ex.orderStatus.key}
 
-         </if>
 
-         <if test="ex.orderStatus != null and ex.orderStatus.key =='YCD'.toString()">
 
-             AND a.is_exception =1
 
-         </if>
 
-         <if test="ex.orderStatus != null and ex.orderStatus.key =='DYY'.toString()">
 
-             AND a.appointment_time IS NULL
 
-         </if>
 
-         <if test="ex.isYb != null and ex.isYb == true">
 
-             AND a.pg_incre_item_id !=''
 
-         </if>
 
-         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0 and adminUserType != null and adminUserType == 0">
 
-             AND (
 
-             a.websit_id IN
 
-             <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-             OR
 
-             a.create_websit_id IN
 
-             <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-             )
 
-         </if>
 
-         ORDER BY a.create_time DESC,id DESC
 
-     </select>
 
-     <select id="workerOrderSettleCountList"
 
-             resultType="com.gree.mall.manager.bean.workorder.WorkerOrderSettleCountVO">
 
-         SELECT
 
-         a.company_wechat_id,
 
-         a.company_wechat_name,
 
-         a.worker_id,
 
-         a.worker_name,
 
-         a.worker_idcard,
 
-         a.worker_mobile,
 
-         COUNT(a.id) AS order_num,
 
-         SUM(a.amount) AS order_amount,
 
-         SUM(a.worker_amount) AS worker_amount
 
-         FROM pg_incre_order a
 
-         ${ex.query}
 
-         AND a.settle_status IN ('OVER', 'EXCEPTION')
 
-         AND a.worker_id <![CDATA[ <> ]]> ''
 
-         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
 
-             AND (
 
-             a.websit_id IN
 
-             <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-             )
 
-         </if>
 
-         GROUP BY
 
-         a.company_wechat_id, a.worker_id
 
-     </select>
 
-     <select id="goodsMaterialList" resultType="com.gree.mall.manager.bean.goods.GoodsMaterialVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM goods_material a
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="goodsPurchaseList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM goods_purchase a
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="goodsPurchaseItemList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseItemVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM goods_purchase a JOIN goods_purchase_item b ON a.id = b.goods_purchase_id
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="goodsPurchaseCodeList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseCodeVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM goods_purchase a
 
-             JOIN goods_purchase_item b ON a.id = b.goods_purchase_id
 
-             JOIN goods_purchase_code c ON b.id = c.goods_purchase_item_id
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC, c.id DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="queryOrderInfoList" resultType="com.gree.mall.manager.bean.listvo.OrderInfoVO">
 
-         SELECT
 
-           ${ex.selected},
 
-           if(a.order_status IN ('NOPAY','TIMEOUT'), '待支付', '已支付') 'payStatus'
 
-         from order_info a
 
-         join order_detail b on a.order_id = b.order_id
 
-         ${ex.query}
 
-         and a.sale_type = 2
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="goodsPurchaseRetList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseRetVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM goods_purchase_ret a
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="goodsPurchaseRetItemList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseRetItemVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM goods_purchase_ret a JOIN goods_purchase_ret_item b ON a.id = b.goods_purchase_ret_id
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="goodsPurchaseRetCodeList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseRetCodeVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM goods_purchase_ret a
 
-         JOIN goods_purchase_ret_item b ON a.id = b.goods_purchase_ret_id
 
-         JOIN goods_purchase_ret_code c ON b.id = c.goods_purchase_ret_item_id
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC, c.id DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="goodsMaterialStockAccList" resultType="com.gree.mall.manager.bean.listvo.goods.GoodsMaterialStockAccVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM goods_material_stock_acc a
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="punishOrderList" resultType="com.gree.mall.manager.bean.listvo.order.PunishOrderVO">
 
-         SELECT
 
-           ${ex.selected}
 
-         FROM punish_order a
 
-         join punish_order_worker b on a.id = b.punish_order_id
 
-         join punish_order_product c on a.id = c.punish_order_id
 
-         ${ex.query}
 
-         <if test="ex.examineStatus != null">
 
-             and a.status = #{ex.examineStatus.key}
 
-         </if>
 
-         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
 
-             AND a.websit_id IN
 
-             <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-         </if>
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="orderOfflineRefundList" resultType="com.gree.mall.manager.bean.order.refund.OrderOfflineRefundVO">
 
-         SELECT
 
-           ${ex.selected}
 
-         from order_offline_refund a
 
-         join order_info b on a.order_id = b.order_id
 
-             ${ex.query}
 
-           ORDER BY a.create_time DESC
 
-     </select>
 
-     <select id="workerSettleExpenseGatherList" resultType="com.gree.mall.manager.bean.settle.SettleExpenseVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM settle_expense a
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="workerSettleExpenseList" resultType="com.gree.mall.manager.bean.settle.SettleExpenseItemVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM settle_expense_item a JOIN settle_expense b ON a.settle_expense_id = b.id
 
-         ${ex.query}
 
-         <if test="workerId != null">
 
-             AND (a.worker_name1 = #{workerId} OR a.worker_name2 = #{workerId})
 
-         </if>
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="settleMonthWagesGatherList" resultType="com.gree.mall.manager.bean.settle.SettleMonthWagesVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM settle_month_wages a
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="settleMonthWagesList" resultType="com.gree.mall.manager.bean.settle.SettleMonthWagesWorkerVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM settle_month_wages_worker a LEFT JOIN settle_month_wages_detail b ON a.settle_month_wages_detail_id = b.id
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.worker_id DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="goodsLeaseList" resultType="com.gree.mall.manager.bean.goods.GoodsLeaseBean">
 
-         SELECT
 
-             a.*
 
-         FROM goods_lease a
 
-         WHERE
 
-         a.del = 0
 
-         <if test='companyWechatIds != null and companyWechatIds.size > 0' >
 
-             AND a.company_wechat_id  in
 
-             <foreach collection="companyWechatIds" open="(" close=")" item="companyWechatId" separator=",">
 
-                 #{companyWechatId}
 
-             </foreach>
 
-         </if>
 
-         <if test="keyword != null and keyword != ''">
 
-             AND
 
-             (a.id LIKE CONCAT('%', #{keyword},'%') OR a.name LIKE CONCAT('%',#{keyword},'%') OR a.category_name
 
-             LIKE CONCAT('%',#{keyword},'%'))
 
-         </if>
 
-         <if test="startPrice != null and endPrice != null">
 
-             AND
 
-             a.lease_price BETWEEN #{startPrice} AND #{endPrice}
 
-         </if>
 
-         <if test="startDeposit != null and endDeposit != null">
 
-             AND
 
-             a.deposit_price BETWEEN #{startDeposit} AND #{endDeposit}
 
-         </if>
 
-         <if test="categoryIds != null and categoryIds.size() != 0">
 
-             AND
 
-             a.category_id IN
 
-             <foreach item="item" index="index" collection="categoryIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-         </if>
 
-         <if test="status != null">
 
-             AND
 
-             a.status = #{status}
 
-         </if>
 
-         <choose>
 
-             <when test="sortStr == null">
 
-                 ORDER BY a.sort DESC,a.create_time DESC
 
-             </when>
 
-             <otherwise>
 
-                 ORDER BY a.sort DESC,${sortStr},a.create_time DESC
 
-             </otherwise>
 
-         </choose>
 
-     </select>
 
-     <select id="leaseOrderList" resultType="com.gree.mall.manager.bean.order.LeaseOrderVO">
 
-         SELECT
 
-             a.*,
 
-             b.category_id,
 
-             b.category_name,
 
-             b.category_url,
 
-             b.goods_lease_id,
 
-             b.goods_lease_name,
 
-             b.goods_unit,
 
-             b.qty,
 
-             b.deposit_price,
 
-             b.lease_price,
 
-             b.start_date,
 
-             b.end_date,
 
-             b.real_end_date
 
-         FROM
 
-              lease_order a LEFT JOIN lease_order_item b ON a.id = b.lease_order_id
 
-         WHERE
 
-             a.pay_status = 1
 
-             <if test='companyWechatIds != null and companyWechatIds.size > 0' >
 
-                 AND a.company_wechat_id  in
 
-                 <foreach collection="companyWechatIds" open="(" close=")" item="companyWechatId" separator=",">
 
-                     #{companyWechatId}
 
-                 </foreach>
 
-             </if>
 
-             <if test="orderId != null and orderId != ''">
 
-                 AND a.id LIKE CONCAT('%', #{orderId},'%')
 
-             </if>
 
-             <if test="goodsName != null and goodsName != ''">
 
-                 AND b.goods_lease_name LIKE CONCAT('%', #{goodsName},'%')
 
-             </if>
 
-             <if test="userName != null and userName != ''">
 
-                 AND a.user_name LIKE CONCAT('%', #{userName},'%')
 
-             </if>
 
-             <if test="userMobile != null and userMobile != ''">
 
-                 AND a.user_mobile LIKE CONCAT('%', #{userMobile},'%')
 
-             </if>
 
-             <if test="status != null and status != ''">
 
-                 AND a.status = #{status}
 
-             </if>
 
-             <if test="startDate != null and endDate != null">
 
-                 AND
 
-                 a.create_time BETWEEN #{startDate} AND #{endDate}
 
-             </if>
 
-             <if test="startPayDate != null and endPayDate != null">
 
-                 AND
 
-                 a.pay_time BETWEEN #{startPayDate} AND #{endPayDate}
 
-             </if>
 
-         ORDER BY a.create_time DESC
 
-     </select>
 
-     <select id="goodsLibraryList" resultType="com.gree.mall.manager.bean.listvo.goods.GoodsLibraryVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM goods_library a
 
-         join goods_library_spec b on a.goods_library_id = b.goods_library_id
 
-         ${ex.query}
 
-         group by a.goods_library_id
 
-         ORDER BY a.update_time DESC
 
-     </select>
 
-     <select id="repairSettleBankAccountList"
 
-             resultType="com.gree.mall.manager.bean.settle.repair.DailyBankAccountVO">
 
-         SELECT
 
-             ${ex.selected}
 
-         FROM
 
-             settle_daily_bank_account a
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="repairSettleDailyWithholdList"
 
-             resultType="com.gree.mall.manager.bean.settle.repair.DailyWithholdVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM
 
-         settle_daily_withhold a
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="repairSettleDailyImportSummaryList"
 
-             resultType="com.gree.mall.manager.bean.settle.repair.DailyImportSummaryVO">
 
-         SELECT
 
-             a.company_wechat_id,
 
-             a.company_wechat_name,
 
-             a.import_batch_no,
 
-             COUNT(DISTINCT a.repair_worker_mobile) AS personNums,
 
-             COUNT(1) AS 'orderNums',
 
-             SUM(a.total_fee) AS 'totalAmount',
 
-             IF(find_in_set('1', group_concat(DISTINCT a.summary_status)) > 0 , 1, 2) AS 'summaryStatus',
 
-             import_by ,
 
-             import_time ,
 
-             group_concat(DISTINCT summary_by) AS 'summaryBy',
 
-             summary_time AS 'summaryTime',
 
-             group_concat(DISTINCT summary_batch_no) AS 'summaryBatchNo' ,
 
-             group_concat(DISTINCT month) AS 'month'
 
-         FROM
 
-             settle_daily_import_summary_item a
 
-         ${ex.query}
 
-         GROUP BY
 
-             a.company_wechat_id, a.import_batch_no
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="repairDetailList"
 
-             resultType="com.gree.mall.manager.bean.settle.repair.DailyImportSummaryItemVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM
 
-         settle_daily_import_summary_item a
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="reduceCountList"
 
-             resultType="com.gree.mall.manager.bean.settle.repair.DailyIncrDecrCostCountVO">
 
-         SELECT
 
-             company_wechat_id,
 
-             company_wechat_name,
 
-             import_batch_no,
 
-             count(service_number) personNums,
 
-             count(id) orderNums,
 
-             sum(cost_amount) totalAmount,
 
-             do_status,
 
-             import_by,
 
-             import_time,
 
-             do_by,
 
-             do_time,
 
-             do_batch_no
 
-         FROM
 
-             settle_daily_incr_decr_cost a
 
-         ${ex.query}
 
-         GROUP BY a.company_wechat_id, a.import_batch_no
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="repairSettleDailyincrDecrCostList"
 
-             resultType="com.gree.mall.manager.bean.settle.repair.DailyIncrDecrCostVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM
 
-         settle_daily_incr_decr_cost a
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="reduceTotalList" resultType="com.gree.mall.manager.bean.settle.repair.DailyReduceCostGatherVO">
 
-         SELECT
 
-             company_wechat_id,
 
-             company_wechat_name,
 
-             COUNT(DISTINCT repair_worker_mobile) AS 'personNums',
 
-             COUNT(1) AS 'orderNums',
 
-             SUM(total_fee) AS 'totalAmount',
 
-             import_by ,
 
-             import_time ,
 
-             import_batch_no,
 
-             do_status,
 
-             do_by ,
 
-             do_time ,
 
-             do_batch_no
 
-         FROM
 
-             settle_daily_reduce_cost a
 
-         ${ex.query}
 
-         GROUP BY a.company_wechat_id, a.import_batch_no
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="reduceList" resultType="com.gree.mall.manager.bean.settle.repair.DailyReduceCostVO">
 
-         SELECT
 
-             ${ex.selected}
 
-         FROM
 
-             settle_daily_reduce_cost a
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="buckleList" resultType="com.gree.mall.manager.bean.settle.repair.WorkerWaitBuckleVO">
 
-         SELECT
 
-             ${ex.selected}
 
-         FROM
 
-             settle_daily_remaine_buckle a
 
-             JOIN user aa on a.worker_number = aa.worker_number
 
-             JOIN settle_daily_bank_account b ON aa.id_card = b.idcard
 
-         ${ex.query}
 
-         GROUP BY a.company_wechat_id, a.idcard
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="transferList"
 
-             resultType="com.gree.mall.manager.bean.settle.repair.SettleDailyBankTransferRecordVO">
 
-         SELECT
 
-             ${ex.selected}
 
-         FROM
 
-             settle_daily_bank_transfer_record a
 
-         ${ex.query}
 
-         <if test="companyWechatIds != null and companyWechatIds.size > 0">
 
-             AND a.company_wechat_id IN
 
-             <foreach item="item" index="index" collection="companyWechatIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-         </if>
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="repairAllList" resultType="com.gree.mall.manager.bean.settle.repair.AllDailyImportSummaryItemVO">
 
-         SELECT
 
-             ${ex.selected}
 
-         FROM
 
-             settle_daily_import_summary_item  a
 
-             LEFT JOIN settle_daily_reduce_cost sdrc  on a.dispatch_order_no = sdrc.dispatch_order_no
 
-             LEFT JOIN user aa on a.worker_number = aa.worker_number
 
-             LEFT JOIN settle_daily_bank_account b ON aa.id_card = b.idcard
 
-             LEFT JOIN settle_daily_issue_summary_record c ON c.id  = a.issue_salary_id
 
-         ${ex.query}
 
-         <if test="companyWechatIds != null and companyWechatIds.size > 0">
 
-             AND a.company_wechat_id IN
 
-             <foreach item="item" index="index" collection="companyWechatIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-         </if>
 
-         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
 
-             AND a.websit_number IN
 
-             <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-         </if>
 
-         GROUP BY a.id
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time, a.id DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="repairAllCount" resultType="java.lang.Integer">
 
-         SELECT
 
-             COUNT(1)
 
-         FROM
 
-             settle_daily_import_summary_item a JOIN settle_daily_issue_summary_record c ON c.id = a.issue_salary_id
 
-         <if test="companyWechatIds != null and companyWechatIds.size > 0">
 
-             AND a.company_wechat_id IN
 
-             <foreach item="item" index="index" collection="companyWechatIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-         </if>
 
-         <if test="adminWebsitIds != null and adminWebsitIds.size > 0">
 
-             AND a.websit_number IN
 
-             <foreach item="item" index="index" collection="adminWebsitIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-         </if>
 
-         WHERE
 
-             c.status = #{status}
 
-     </select>
 
-     <select id="companyDelivery" resultType="com.gree.mall.manager.bean.member.UserCompanyDeliveryVO">
 
-         SELECT
 
-             ${ex.selected}
 
-         FROM
 
-             user_company_delivery a JOIN user b ON a.user_id = b.user_id
 
-             LEFT JOIN user_company_delivery_rela c ON b.user_id = c.user_id AND a.company_wechat_id = c.company_wechat_id
 
-             LEFT JOIN admin_company_wechat d ON a.company_wechat_id = d.company_wechat_id
 
-             LEFT JOIN storage e ON a.company_wechat_id = e.company_wechat_id AND c.storage_id = e.storage_id
 
-         ${ex.query}
 
-             AND b.type = 'WORKER'
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY b.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="companyCredit" resultType="com.gree.mall.manager.bean.member.UserCompanyCreditVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM
 
-         user_company_credit a JOIN user b ON a.user_id = b.user_id
 
-         ${ex.query}
 
-             AND b.type = 'WORKER'
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="adminCompanyPayConfigList"
 
-             resultType="com.gree.mall.manager.bean.admin.AdminCompanyPayConfigVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM
 
-         admin_company_wechat_pay_config a
 
-         ${ex.query}
 
-         AND a.del = 0
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="orderPickTimeConfigList2" resultType="com.gree.mall.manager.bean.order.OrderPickTimeConfigVO">
 
-         SELECT
 
-             ${ex.selected},
 
-             b.storage_name
 
-         FROM order_pick_time_config a LEFT JOIN storage b ON a.storage_id = b.storage_id
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.id DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="userCompanyCreditBillPage"
 
-             resultType="com.gree.mall.manager.bean.user.UserCompanyCreditBillVO">
 
-         SELECT
 
-         ${ex.selected},
 
-         (IFNULL(a.amount, 0) - IFNULL(a.remaining_amount, 0)) AS pay_amount
 
-         FROM user_company_credit_bill a LEFT JOIN user b ON a.user_id = b.user_id
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.bill_id DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="userCompanyCreditBillItemPage"
 
-             resultType="com.gree.mall.manager.bean.user.UserCompanyCreditBillItemVO">
 
-         SELECT
 
-         ${ex.selected},
 
-         b.nick_name
 
-         FROM user_company_credit_bill_item a LEFT JOIN user b ON a.user_id = b.user_id
 
-         ${ex.query}
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.id DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="goodsPriceChangePage" resultType="com.gree.mall.manager.bean.goods.GoodsPriceChangeVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM goods_price_change a LEFT JOIN goods b ON a.goods_id = b.goods_id
 
-         LEFT JOIN goods_spec c ON a.goods_spec_id = c.goods_spec_id
 
-         ${ex.query}
 
-         GROUP BY a.sheet_id
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
-     <select id="goodsStockWarningList" resultType="com.gree.mall.manager.bean.goods.GoodsStockWarningVO">
 
-         SELECT
 
-         ${ex.selected}
 
-         FROM goods_storage_warning_record a LEFT JOIN goods b ON a.goods_id = b.goods_id
 
-         LEFT JOIN goods_material c ON a.goods_material_id = c.id
 
-         ${ex.query}
 
-         <if test="ex.companyWechatId != null and ex.companyWechatId != ''">
 
-             AND a.company_wechat_id = ${ex.companyWechatId}
 
-         </if>
 
-         <if test="storageIds != null and storageIds.size > 0">
 
-             AND a.storage_id IN
 
-             <foreach item="item" index="index" collection="storageIds" open="(" separator="," close=")">
 
-                 #{item}
 
-             </foreach>
 
-         </if>
 
-         <if test="ex.orderBy == null or ex.orderBy ==''">
 
-             ORDER BY a.create_time DESC
 
-         </if>
 
-         ${ex.orderBy}
 
-     </select>
 
- </mapper>
 
 
  |