123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767 |
- <?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},
- 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="ex.checkCert != null and ex.checkCert == true">
- AND b.examine_status IN ('OK', 'EXPIRED')
- </if>
- <if test="slaveWorkerList != null and slaveWorkerList.size > 0">
- AND a.user_id IN
- <foreach item="item" index="index" collection="slaveWorkerList" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- and a.apply_type='WORKER'
- <if test="ex.isGroupByWorkerId != null and ex.isGroupByWorkerId == true">
- GROUP BY a.worker_number
- </if>
- ORDER BY b.create_time DESC
- </select>
- <select id="userServiceList" resultType="com.gree.mall.manager.bean.listvo.User2VO">
- select
- ${ex.selected}
- from user a
- ${ex.query}
- and a.apply_type='SERVICE'
- 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="websitStockList" resultType="com.gree.mall.manager.bean.listvo.material.WebsitStockVO">
- select
- ${ex.selected},
- d.category_name 'categoryName2'
- from websit_stock a
- join websit_goods b on a.goods_id = b.goods_id
- left join websit_goods_category c on b.parent_category_id = c.category_id
- left join websit_goods_category d on b.goods_category_id = d.category_id
- left join storage e on a.storage_id = e.storage_id
- ${ex.query}
- and a.goods_type='M'
- <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="websitStockPList" resultType="com.gree.mall.manager.bean.listvo.material.WebsitStockPVO">
- select
- ${ex.selected}
- from websit_stock a
- join websit_goods b on a.goods_id = b.goods_code
- left join storage c on a.storage_id = c.storage_id
- ${ex.query}
- and a.goods_type='P'
- <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="websitStockAccList" resultType="com.gree.mall.manager.bean.listvo.material.WebsitStockAccVO">
- select
- ${ex.selected},
- d.category_name 'categoryName2'
- from websit_stock_acc a
- join websit_goods b on a.goods_id = b.goods_id
- left join websit_goods_category c on b.parent_category_id = c.category_id
- left join websit_goods_category d on b.goods_category_id = d.category_id
- left join storage e on a.storage_id = e.storage_id
- ${ex.query}
- and a.goods_type='M'
- <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="websitStockAccPList" resultType="com.gree.mall.manager.bean.listvo.material.WebsitStockAccPVO">
- select
- ${ex.selected}
- from websit_stock_acc a
- join websit_goods b on a.goods_id = b.goods_code
- left join storage c on a.storage_id = c.storage_id
- ${ex.query}
- and a.goods_type='P'
- <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="workerStockList" resultType="com.gree.mall.manager.bean.listvo.material.WorkerStockVO">
- select
- ${ex.selected},
- d.category_name 'categoryName2'
- from worker_stock a
- join worker_goods b on a.goods_id = b.goods_id
- left join websit_goods_category c on b.parent_category_id = c.category_id
- left join websit_goods_category d on b.goods_category_id = d.category_id
- left join user e on e.id_card = a.identity
- ${ex.query}
- and a.goods_type='M'
- <if test="workers != null and workers.size > 0">
- AND (
- a.identity IN
- <foreach item="item" index="index" collection="workers" open="(" separator="," close=")">
- #{item}
- </foreach>
- )
- </if>
- order by a.id desc
- </select>
- <select id="workerStockAccList" resultType="com.gree.mall.manager.bean.listvo.material.WorkerStockAccVO">
- select
- ${ex.selected},
- d.category_name 'categoryName2'
- from worker_stock_acc a
- join worker_goods b on a.goods_id = b.goods_id
- left join websit_goods_category c on b.parent_category_id = c.category_id
- left join websit_goods_category d on b.goods_category_id = d.category_id
- left join user e on e.id_card = a.identity
- ${ex.query}
- and a.goods_type='M'
- <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="workerStockPList" resultType="com.gree.mall.manager.bean.listvo.material.WorkerStockPVO">
- select
- ${ex.selected}
- from worker_stock a
- join websit_goods b on a.goods_id = b.goods_code
- left join user e on e.worker_number = a.worker_id
- ${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>
- and a.goods_type='P'
- order by a.id desc
- </select>
- <select id="workerStockAccPList" resultType="com.gree.mall.manager.bean.listvo.material.WorkerStockAccPVO">
- select
- ${ex.selected}
- from worker_stock_acc a
- join websit_goods b on a.goods_id = b.goods_code
- left join user e on e.worker_number = a.worker_id
- ${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>
- and a.goods_type='P'
- order by a.id 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.sort_num asc
- </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 and a.order_status NOT IN ('YWG','YWGO','YJS')
- </if>
- <if test="ex.orderStatus != null and ex.orderStatus.key =='DYY'.toString()">
- and a.appointment_time is null and a.order_status not in ('YWG','GCSZX','WDWG','YWGO','YQX','FWZT','YCGB',
- 'FWQX','FL','YJS','LRCD','DSHPG','CJ','YPD','DXSPD','DZBPG','DWDSPGP','DXSSPGP','DTJXSSPGP','DZBSPGP'
- )
- </if>
- <if test="ex.orderStatus != null and ex.orderStatus.key =='DJD'.toString()">
- and (a.is_meet =0 or a.order_status IN ('DJD')) and a.order_status not in ('YQX','FWQX','FL','FWZT','YCGB')
- </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="orderBaseId != null and orderBaseId.size > 0 ">
- AND
- a.id IN
- <foreach item="item" index="index" collection="orderBaseId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </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>
- 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="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="buyServiceRecordList" resultType="com.gree.mall.manager.bean.serivce.BuyServiceRecordVO">
- SELECT
- ${ex.selected}
- FROM buy_service_record a
- ${ex.query}
- <if test="companyName != null and companyName !=''">
- AND a.company_name = #{companyName}
- </if>
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </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="projectRepairList" resultType="com.gree.mall.manager.bean.engin.ProjectRepairVO">
- SELECT
- ${ex.selected}
- FROM rp_project_repair a LEFT JOIN rp_project_repair_websit b ON a.id = b.project_repair_id
- ${ex.query}
- <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
- AND (
- b.websit_id 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 DESC
- </if>
- ${ex.orderBy}
- </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="orderEnginBaseList" resultType="com.gree.mall.manager.bean.engin.OrderEnginBaseVO">
- SELECT
- ${ex.selected}
- FROM order_engin_base 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.adminWebsitIds != null and ex.adminWebsitIds.size > 0' >
- AND a.websit_id in
- <foreach collection="ex.adminWebsitIds" open="(" close=")" item="item" separator=",">
- #{item}
- </foreach>
- </if>
- <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.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="settleMonthWagesGatherList" resultType="com.gree.mall.manager.bean.settle.SettleMonthWagesVO">
- SELECT
- ${ex.selected}
- FROM settle_month_wages 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>
- <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="promotionQuestionnairList" resultType="com.gree.mall.manager.bean.listvo.PromotionQuestionnairVO">
- SELECT
- ${ex.selected},
- if(is_stop=1,'已终止',if(a.start_time > now(),'待生效',if(now() between a.start_time and a.end_time,'生效中','已过期'))) 'statusText'
- FROM promotion_questionnaire a
- ${ex.query}
- <if test="status != null">
- <if test="status == 0">
- and a.start_time > now()
- </if>
- <if test="status == 1">
- and now() between a.start_time and a.end_time and is_stop=0
- </if>
- <if test="status == 2">
- and a.end_time < now()
- </if>
- <if test="status == 3">
- and a.is_stop = 1
- </if>
- </if>
- ORDER BY a.create_time DESC
- </select>
- <select id="promotionActivityList" resultType="com.gree.mall.manager.bean.activity.PromotionActivityVO">
- SELECT
- ${ex.selected},
- b.create_by AS orderCreateBy,
- b.create_time AS orderCreateTime,
- b.create_mobile AS orderCreateMobile
- FROM
- promotion_activity a LEFT JOIN promotion_questionnaire b ON a.promotion_questionnaire_id = b.id
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="esGoodsList" resultType="com.gree.mall.manager.bean.es.ESGoodsVO">
- SELECT
- ${ex.selected}
- FROM
- es_goods 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="esGoodsMessageList" resultType="com.gree.mall.manager.bean.es.EsGoodsMessageVO">
- SELECT
- a.*,
- b.content AS replyContent,
- b.reply_time,
- b.reply_by
- FROM
- es_goods_message a LEFT JOIN es_goods_message_reply b ON a.id = b.es_goods_message_id
- WHERE
- a.es_goods_id = #{id}
- </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="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 AND aa.apply_type = 'WORKER'
- 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 AND aa.apply_type = 'WORKER'
- 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="queryComList" resultType="com.gree.mall.manager.plus.entity.ComList">
- select
- a.*
- from
- com_list a join com_detail b on a.id=b.com_list_id
- where
- <if test="adminWebsitIds != null and adminWebsitIds.size > 0">
- b.websit_id IN
- <foreach item="item" index="index" collection="adminWebsitIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- AND
- </if>
- a.is_notice=1 and a.is_pwd = 0
- and not exists (select 1 from com_detail_log where user_name=#{userName} and com_list_id=a.id)
- </select>
- <select id="list" resultType="com.gree.mall.manager.bean.common.CallRecordVo">
- SELECT
- ${ex.selected}
- FROM
- call_send_record a
- ${ex.query}
- <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>
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time, a.id DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="settleRelaConfigPage"
- resultType="com.gree.mall.manager.bean.contract.SettleRelaConfigVO">
- SELECT
- ${ex.selected},
- b.name AS parentName,
- d.name AS subName
- FROM
- websit_follow_config a
- JOIN admin_websit b ON a.websit_id = b.websit_id
- LEFT JOIN websit_follow_config_item c ON a.websit_id = c.parent_id
- LEFT JOIN admin_websit d ON c.sub_websit_id = d.websit_id
- ${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>
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="listOrder" resultType="com.gree.mall.manager.bean.common.CallRecordOrderVo">
- SELECT
- ${ex.selected}
- FROM
- call_record a
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="contractTemplatePage" resultType="com.gree.mall.manager.bean.contract.ContractTemplateVO">
- SELECT
- ${ex.selected},
- b.contract_template_name AS followContractTemplateName
- FROM
- contract_template a
- LEFT JOIN contract_template b ON a.follow_contract_template_id = b.contract_template_id
- ${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="contractWebsitList" resultType="com.gree.mall.manager.bean.contract.ContractWebsitBean">
- SELECT
- a.*,
- d.name AS parent_name,
- d.websit_id AS parent_id,
- c.name,
- d.belong_company,
- d.belong_company_code
- FROM
- contract_websit a
- LEFT JOIN websit_follow_config_item b ON a.sub_websit_id = b.sub_websit_id
- LEFT JOIN admin_websit c on a.sub_websit_id = c.websit_id
- LEFT JOIN admin_websit d on b.parent_id = d.websit_id
- WHERE
- a.contract_template_id = #{contractTemplateId}
- </select>
- <select id="querySettleRelaWebsit" resultType="com.gree.mall.manager.bean.contract.ContractWebsitBean">
- SELECT
- b.name AS parent_name,
- c.name,
- a.sub_websit_id,
- b.belong_company,
- b.belong_company_code
- FROM
- websit_follow_config_item a
- LEFT JOIN admin_websit b ON a.parent_id = b.websit_id
- LEFT JOIN admin_websit c ON a.sub_websit_id = c.websit_id
- <where>
- <if test="contractTemplateId != null and contractTemplateId != ''">
- AND a.sub_websit_id NOT IN (SELECT sub_websit_id FROM contract_websit WHERE contract_template_id = #{contractTemplateId})
- </if>
- <if test="websitId != null and websitId != ''">
- AND a.sub_websit_id = #{websitId}
- </if>
- <if test="websitName != null and websitName != ''">
- AND c.name LIKE CONCAT('%', #{websitName}, '%')
- </if>
- </where>
- ORDER BY b.belong_company_code, a.parent_id, a.sub_websit_id
- </select>
- <select id="companyCaAuthPage" resultType="com.gree.mall.manager.bean.contract.CompanyCaAuthVO">
- SELECT
- ${ex.selected}
- FROM
- company_ca_auth a
- LEFT JOIN admin_websit b ON a.websit_id = b.websit_id
- ${ex.query}
- AND a.del = 0
- <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="websitContractSignPage" resultType="com.gree.mall.manager.bean.contract.WebsitContractSignVO">
- SELECT
- ${ex.selected}
- FROM
- websit_contract_sign_record a
- ${ex.query}
- <if test="websitId != null">
- AND a.websit_id = #{websitId}
- </if>
- <if test="websitId == null and ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
- AND a.parent_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="queryNeedContract" resultType="com.gree.mall.manager.plus.entity.ContractTemplate">
- SELECT
- b.*
- FROM
- contract_websit a,
- contract_template b
- WHERE
- a.company_wechat_id = b.company_wechat_id
- AND a.contract_template_id = b.contract_template_id
- AND a.company_wechat_id = #{companyId}
- AND a.sub_websit_id = #{websitId}
- AND #{onDate} BETWEEN b.valid_date AND b.expire_date
- AND b.contract_type = 'MAIN'
- AND b.status = 'ON'
- ORDER BY
- create_time
- </select>
- <select id="selectMainContractIdByValidDate" resultType="java.lang.String">
- SELECT
- contract_template_id
- FROM
- `contract_template`
- WHERE
- company_wechat_id = #{companyId}
- AND contract_type = 'MAIN'
- AND `status` = 'ON'
- AND #{onDate} BETWEEN valid_date AND expire_date
- </select>
- <select id="workerTeamPage" resultType="com.gree.mall.manager.bean.worker.WorkerTeamVO">
- SELECT
- ${ex.selected}
- FROM
- worker_team a
- LEFT JOIN admin_websit b ON a.websit_id = b.websit_id
- ${ex.query}
- <if test="workerId != null and workerId != ''">
- AND (a.master_worker_id = #{workerId} OR a.assistant_worker_id = #{workerId})
- </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="appraiseCategoryList" resultType="com.gree.mall.manager.bean.workorder.PgAppraiseCategoryVO">
- SELECT
- ${ex.selected},
- b.name AS parentName
- FROM
- pg_appraise_category a
- LEFT JOIN pg_appraise_category b ON a.parent_id = b.id
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="appraiseApplyList" resultType="com.gree.mall.manager.bean.workorder.PgAppraiseApplyVO">
- SELECT
- ${ex.selected}
- FROM
- pg_appraise_apply 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>
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.update_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="workerManagerCheck" resultType="com.gree.mall.manager.bean.workorder.WorkerNumberCheckVO">
- SELECT
- ${ex.selected}
- FROM
- worker_number_check a
- JOIN `user` c on c.nick_name = a.worker_name and RIGHT(c.mobile,4) = RIGHT(a.worker_phone_yun,4)
- JOIN websit_user d on a.websit_id = d.websit_id and c.user_id = d.user_id and d.examine_status = 'OK'
- LEFT JOIN admin_websit b on a.websit_id = b.websit_id
- ${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>
- HAVING a.worker_number_yun != d.worker_number
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.websit_id,a.worker_number_yun DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="workerManagerCheckCount" resultType="java.lang.Integer">
- SELECT
- COUNT( 1 )
- FROM
- (
- SELECT
- a.worker_number_yun,
- d.worker_number
- FROM
- worker_number_check a
- JOIN `user` c on c.nick_name = a.worker_name and RIGHT(c.mobile,4) = RIGHT(a.worker_phone_yun,4)
- JOIN websit_user d on a.websit_id = d.websit_id and c.user_id = d.user_id and d.examine_status = 'OK'
- LEFT JOIN admin_websit b on a.websit_id = b.websit_id
- ${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>
- HAVING a.worker_number_yun != d.worker_number
- ) s
- </select>
- <select id="workerSignConfirmPage" resultType="com.gree.mall.manager.bean.worker.WorkerElecConfirmVO">
- SELECT
- ${ex.selected}
- FROM
- (
- SELECT
- a.user_id,
- a.worker_number,
- b.belong_company_code,
- b.belong_company,
- c.nick_name,
- c.mobile,
- c.id_card,
- d.url,
- d.create_time,
- IF(IFNULL(d.create_time, 1)=1, 'NO', 'YES') AS status
- FROM
- websit_user a
- LEFT JOIN admin_websit b ON a.websit_id = b.websit_id
- LEFT JOIN `user` c ON a.user_id = c.user_id
- LEFT JOIN worker_sign_confirm d ON b.belong_company_code = d.belong_company_code AND a.user_id = d.user_id
- WHERE
- a.examine_status IN ('OK', 'EXPIRED')
- AND b.attr = 'SELF'
- GROUP BY
- b.belong_company_code,
- a.user_id
- ) a
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="workerSignConfirmCount" resultType="java.lang.Long">
- SELECT
- COUNT(DISTINCT CONCAT( b.belong_company_code, '-', a.user_id )) AS total
- FROM
- websit_user a
- INNER JOIN admin_websit b ON a.websit_id = b.websit_id AND b.attr = 'SELF'
- LEFT JOIN worker_sign_confirm d ON b.belong_company_code = d.belong_company_code AND a.user_id = d.user_id
- WHERE
- a.examine_status IN ( 'OK', 'EXPIRED' )
- AND d.create_time IS NULL
- </select>
- <select id="workerSignConfirmManualPage"
- resultType="com.gree.mall.manager.bean.worker.WorkerElecConfirmManualVO">
- SELECT
- ${ex.selected}
- FROM
- worker_sign_confirm_manual a
- ${ex.query}
- AND a.status IN ('WAIT')
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="qualityFeedbackPage" resultType="com.gree.mall.manager.bean.quality.QualityFeedbackVO">
- SELECT
- ${ex.selected}
- FROM
- quality_feedback 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>
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="principalPage" resultType="com.gree.mall.manager.bean.apply.WorkerInvolvePrincipalVO">
- SELECT
- ${ex.selected}
- FROM
- worker_involve_principal a
- join worker_involve_principal_item b on a.id = b.principal_id
- ${ex.query}
- <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
- AND b.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="listApply" resultType="com.gree.mall.manager.bean.apply.WorkerInvolveApplyVO">
- SELECT
- ${ex.selected}
- FROM
- worker_involve_apply a
- join pg_order_base b on a.order_base_id = b.id
- ${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>
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- </mapper>
|