123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705 |
- <?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.workorder.IncreMapper">
- <select id="list" resultType="com.gree.mall.manager.bean.workorder.IncreVO">
- SELECT
- ${ex.selected}
- FROM pg_incre a
- ${ex.query}
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND a.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" 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="listDispatch" resultType="com.gree.mall.manager.bean.workorder.DispatchVO">
- SELECT
- a.province_name,
- a.province_code,
- a.city_name,
- a.city_code,
- a.area_name,
- a.area_code,
- a.name as streetName,
- a.id as streetCode,
- c.order_small_type_text,
- c.id as orderSmallId,
- d.name as categoryName,
- d.category_id,
- e.dict_value as saleTypeName,
- e.dict_code as saleTypeId
- FROM
- region a
- join order_small_type c on
- a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
- AND a.`level` = 4
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND c.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND d.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join sys_dict_company e on e.dict_type = 'SALES_TYPE' and e.del = 0 and e.dict_code > 100
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND e.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- ${ex.query}
- <if test="codeList != null and codeList.size > 0">
- AND CONCAT(a.id,e.dict_code,c.id,d.category_id) not In
- <foreach item="item" index="index" collection="codeList" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- <select id="listDispatchWebsit" resultType="com.gree.mall.manager.bean.workorder.WebsitDispatchVO">
- SELECT
- ${ex.selected}
- FROM websit_dispatch a
- ${ex.query}
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND a.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" 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="pList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
- SELECT
- a.province_name as valueName,
- a.province_code as keyId
- FROM
- region a
- join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND b.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join order_small_type c
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- on c.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND d.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND f.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- where 1=1
- and
- a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
- AND a.`level` = 4
- and f.id is null
- <if test="pId != null and pId !=''">
- AND a.province_code = #{pId}
- </if>
- <if test="cityCode != null and cityCode !=''">
- AND a.city_code = #{cityCode}
- </if>
- <if test="areaCode != null and areaCode !=''">
- AND a.area_code = #{areaCode}
- </if>
- <if test="streetCode != null and streetCode !=''">
- AND a.id = #{streetCode}
- </if>
- <if test="sales != null and sales.size > 0">
- AND b.dict_code IN
- <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="orderSmallId != null and orderSmallId.size > 0">
- AND c.id in
- <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="categoryId != null and categoryId.size > 0">
- AND d.category_id in
- <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- group by a.province_code
- </select>
- <select id="cList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
- SELECT
- a.city_name as valueName,
- a.city_code as keyId
- FROM
- region a
- join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND b.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join order_small_type c
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- on c.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND d.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND f.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- where 1=1
- and
- a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
- AND a.`level` = 4
- and f.id is null
- <if test="pId != null and pId !=''">
- AND a.province_code = #{pId}
- </if>
- <if test="cityCode != null and cityCode !=''">
- AND a.city_code = #{cityCode}
- </if>
- <if test="areaCode != null and areaCode !=''">
- AND a.area_code = #{areaCode}
- </if>
- <if test="streetCode != null and streetCode !=''">
- AND a.id = #{streetCode}
- </if>
- <if test="sales != null and sales.size > 0">
- AND b.dict_code IN
- <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="orderSmallId != null and orderSmallId.size > 0">
- AND c.id in
- <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="categoryId != null and categoryId.size > 0">
- AND d.category_id in
- <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- group by a.city_code
- </select>
- <select id="aList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
- SELECT
- a.area_name as valueName,
- a.area_code as keyId
- FROM
- region a
- join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND b.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join order_small_type c
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- on c.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND d.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND f.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- where 1=1
- and
- a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
- AND a.`level` = 4
- and f.id is null
- <if test="pId != null and pId !=''">
- AND a.province_code = #{pId}
- </if>
- <if test="cityCode != null and cityCode !=''">
- AND a.city_code = #{cityCode}
- </if>
- <if test="areaCode != null and areaCode !=''">
- AND a.area_code = #{areaCode}
- </if>
- <if test="streetCode != null and streetCode !=''">
- AND a.id = #{streetCode}
- </if>
- <if test="sales != null and sales.size > 0">
- AND b.dict_code IN
- <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="orderSmallId != null and orderSmallId.size > 0">
- AND c.id in
- <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="categoryId != null and categoryId.size > 0">
- AND d.category_id in
- <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- group by a.area_code
- </select>
- <select id="sList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
- SELECT
- a.name as valueName,
- a.id as keyId
- FROM
- region a
- join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND b.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join order_small_type c
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- on c.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND d.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND f.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- where 1=1
- and
- a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
- AND a.`level` = 4
- and f.id is null
- <if test="pId != null and pId !=''">
- AND a.province_code = #{pId}
- </if>
- <if test="cityCode != null and cityCode !=''">
- AND a.city_code = #{cityCode}
- </if>
- <if test="areaCode != null and areaCode !=''">
- AND a.area_code = #{areaCode}
- </if>
- <if test="streetCode != null and streetCode !=''">
- AND a.id = #{streetCode}
- </if>
- <if test="sales != null and sales.size > 0">
- AND b.dict_code IN
- <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="orderSmallId != null and orderSmallId.size > 0">
- AND c.id in
- <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="categoryId != null and categoryId.size > 0">
- AND d.category_id in
- <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- group by a.id
- </select>
- <select id="channel" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
- SELECT
- b.dict_value as valueName,
- b.dict_code as keyId
- FROM
- region a
- join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND b.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join order_small_type c
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- on c.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND d.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND f.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- where 1=1
- and
- a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
- AND a.`level` = 4
- and f.id is null
- <if test="pId != null and pId !=''">
- AND a.province_code = #{pId}
- </if>
- <if test="cityCode != null and cityCode !=''">
- AND a.city_code = #{cityCode}
- </if>
- <if test="areaCode != null and areaCode !=''">
- AND a.area_code = #{areaCode}
- </if>
- <if test="streetCode != null and streetCode !=''">
- AND a.id = #{streetCode}
- </if>
- <if test="dictCode != null and dictCode.size > 0">
- AND b.dict_code IN
- <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="orderSmallId != null and orderSmallId.size > 0">
- AND c.id in
- <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="categoryId != null and categoryId.size > 0">
- AND d.category_id in
- <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="orderSourceId != null and orderSourceId.size > 0">
- AND e.dict_code in
- <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- group by b.dict_code
- </select>
- <select id="smallList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
- SELECT
- c.order_small_type_text as valueName,
- c.id as keyId
- FROM
- region a
- join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND b.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join order_small_type c
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- on c.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND d.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND f.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- where 1=1
- and
- a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
- AND a.`level` = 4
- and f.id is null
- <if test="pId != null and pId !=''">
- AND a.province_code = #{pId}
- </if>
- <if test="cityCode != null and cityCode !=''">
- AND a.city_code = #{cityCode}
- </if>
- <if test="areaCode != null and areaCode !=''">
- AND a.area_code = #{areaCode}
- </if>
- <if test="streetCode != null and streetCode !=''">
- AND a.id = #{streetCode}
- </if>
- <if test="sales != null and sales.size > 0">
- AND b.dict_code IN
- <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="orderSmallId != null and orderSmallId.size > 0">
- AND c.id in
- <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="categoryId != null and categoryId.size > 0">
- AND d.category_id in
- <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- group by c.id
- </select>
- <select id="categoryList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
- SELECT
- d.name as valueName,
- d.category_id as keyId
- FROM
- region a
- join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND b.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join order_small_type c
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- on c.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND d.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND f.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- where 1=1
- and
- a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
- AND a.`level` = 4
- and f.id is null
- <if test="pId != null and pId !=''">
- AND a.province_code = #{pId}
- </if>
- <if test="cityCode != null and cityCode !=''">
- AND a.city_code = #{cityCode}
- </if>
- <if test="areaCode != null and areaCode !=''">
- AND a.area_code = #{areaCode}
- </if>
- <if test="streetCode != null and streetCode !=''">
- AND a.id = #{streetCode}
- </if>
- <if test="sales != null and sales.size > 0">
- AND b.dict_code IN
- <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="orderSmallId != null and orderSmallId.size > 0">
- AND c.id in
- <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="categoryId != null and categoryId.size > 0">
- AND d.category_id in
- <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- group by d.category_id
- </select>
- <select id="sourceList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
- SELECT
- b.dict_value as valueName,
- b.dict_code as keyId
- FROM
- region a
- join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND b.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join order_small_type c
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- on c.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND d.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND f.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- where 1=1
- and
- a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
- AND a.`level` = 4
- and f.id is null
- <if test="pId != null and pId !=''">
- AND a.province_code = #{pId}
- </if>
- <if test="cityCode != null and cityCode !=''">
- AND a.city_code = #{cityCode}
- </if>
- <if test="areaCode != null and areaCode !=''">
- AND a.area_code = #{areaCode}
- </if>
- <if test="streetCode != null and streetCode !=''">
- AND a.id = #{streetCode}
- </if>
- <if test="sales != null and sales.size > 0">
- AND b.dict_code IN
- <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="orderSmallId != null and orderSmallId.size > 0">
- AND c.id in
- <foreach item="item" index="index" collection="orderSmallId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="categoryId != null and categoryId.size > 0">
- AND d.category_id in
- <foreach item="item" index="index" collection="categoryId" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- group by e.dict_code
- </select>
- <select id="listAbnormal" resultType="com.gree.mall.manager.bean.workorder.AbnormalVO">
- SELECT
- ${ex.selected}
- FROM abnormal a
- ${ex.query}
- <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
- AND a.company_wechat_id IN
- <foreach item="item" index="index" collection="adminCompanyIds" 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>
|