123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748 |
- <?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.MaterialMapper">
- <update id="updateItemPushFlag">
- UPDATE websit_parts_sales_item SET push_flag = #{pushFlag} WHERE sales_id = #{id}
- </update>
- <select id="partsBasePage" resultType="com.gree.mall.manager.bean.material.base.PartsBaseVO">
- SELECT
- ${ex.selected}
- FROM websit_parts_base a
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="materialCategoryPage" resultType="com.gree.mall.manager.bean.material.base.MaterialCategoryVO">
- SELECT
- ${ex.selected}
- FROM websit_goods_category a
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.parent_category_id, a.sort, a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="mPage" resultType="com.gree.mall.manager.bean.material.base.WebsitGoodsMVO">
- SELECT
- ${ex.selected}
- FROM websit_goods a LEFT JOIN websit_goods_category b ON a.goods_category_id = b.category_id
- ${ex.query}
- AND a.goods_type = 'M'
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="pPage" resultType="com.gree.mall.manager.bean.material.base.WebsitGoodsPVO">
- SELECT
- ${ex.selected}
- FROM websit_goods a
- ${ex.query}
- AND a.goods_type = 'P'
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="workGoodsPage" resultType="com.gree.mall.manager.bean.material.base.WorkerGoodsVO">
- SELECT
- ${ex.selected}
- FROM worker_goods a LEFT JOIN websit_goods_category b ON a.goods_category_id = b.category_id
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="websitGoodsPricePage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitGoodsPriceVO">
- SELECT
- ${ex.selected}
- FROM websit_goods_price a LEFT JOIN websit_goods b ON a.goods_id = b.goods_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="websitPriceUpdPage" resultType="com.gree.mall.manager.bean.material.manage.WebsitPriceUpdVO">
- SELECT
- ${ex.selected}
- FROM websit_price_upd a
- <!-- LEFT JOIN websit_price_upd_item b ON a.sheet_id = b.sheet_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="websitPurchasePage" resultType="com.gree.mall.manager.bean.material.manage.WebsitPurchaseVO">
- SELECT
- ${ex.selected}
- FROM websit_purchase a LEFT JOIN storage b ON a.storage_id = b.storage_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="websitPurchaseRetPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPurchaseRetVO">
- SELECT
- ${ex.selected}
- FROM websit_purchase_ret a LEFT JOIN storage b ON a.storage_id = b.storage_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="websitVenderPage" resultType="com.gree.mall.manager.bean.material.vender.WebsitVenderVO">
- SELECT
- ${ex.selected}
- FROM websit_vender a
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="websitNormChargePage" resultType="com.gree.mall.manager.bean.material.base.WebsitNormChargeVO">
- SELECT
- ${ex.selected}
- FROM websit_norm_charge a LEFT JOIN websit_goods_category b ON a.category_id = b.category_id
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="websitSalesPage" resultType="com.gree.mall.manager.bean.material.manage.WebsitSalesVO">
- SELECT
- ${ex.selected}
- FROM websit_sales a
- join websit_sales_item b on a.sales_id = b.sales_id
- LEFT JOIN storage c on a.storage_id = c.storage_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="goodsName != null and goodsName != ''">
- AND b.goods_name = #{goodsName}
- </if>
- <if test="goodsSpecification != null and goodsSpecification != ''">
- AND b.goods_specification = #{goodsSpecification}
- </if>
- <if test="isFilter != null and isFilter != ''">
- AND ( (a.goods_Type = 'M' and b.sales_qty != b.ret_qty) or
- (a.goods_Type = 'P' and (b.sales_qty != (b.ret_qty+ b.old_refund_qty)))
- )
- </if>
- GROUP BY a.sales_id
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="existStockCategory" resultType="com.gree.mall.manager.bean.material.stock.WebsitSalesCategoryVO">
- SELECT
- c.category_id,
- c.category_name,
- c.parent_category_id,
- c.parent_category_name
- FROM
- websit_stock a
- LEFT JOIN websit_goods b ON a.goods_id = b.goods_id
- LEFT JOIN websit_goods_category c ON b.goods_category_id = c.category_id
- WHERE
- a.company_wechat_id = #{companyWechatId}
- AND a.websit_id = #{websitId}
- AND a.goods_type = 'M'
- <!-- AND a.qty > 0 -->
- GROUP BY b.goods_category_id
- </select>
- <select id="existStockGoods" resultType="com.gree.mall.manager.bean.material.stock.WebsitSalesGoodsVO">
- SELECT
- a.goods_id,
- b.goods_name,
- <if test="goodsType=='M'.toString()">
- c.price,
- </if>
- <if test="goodsType=='P'.toString()">
- b.market_price AS price,
- </if>
- b.goods_code,
- b.goods_spell,
- b.goods_specification,
- b.goods_stock_unit,
- b.goods_sales_unit,
- b.brand_rela_name,
- b.product_rela_name,
- SUM(a.qty) AS qty,
- 'BASE' AS itemSourceType,
- a.goods_id AS itemSourceId,
- b.norm_type,
- b.material_group_name
- FROM
- websit_stock a
- JOIN websit_goods b ON
- <if test="goodsType!=null and goodsType!='' and goodsType=='M'.toString()">
- a.goods_id = b.goods_id
- </if>
- <if test="goodsType!=null and goodsType!='' and goodsType=='P'.toString()">
- a.goods_id = b.goods_code
- </if>
- <if test="goodsType=='M'.toString()">
- LEFT JOIN websit_goods_price c ON a.goods_id = c.goods_id AND a.websit_id = c.websit_id
- </if>
- WHERE
- a.company_wechat_id = #{companyWechatId}
- <if test="goodsType=='M'.toString() and categoryId!=null and categoryId!=''">
- AND b.goods_category_id = #{categoryId}
- </if>
- <if test="goodsName!=null and goodsName!=''">
- AND b.goods_name LIKE CONCAT('%',#{goodsName},'%')
- </if>
- <if test="goodsSpecification!=null and goodsSpecification!=''">
- AND b.goods_specification LIKE CONCAT('%',#{goodsSpecification},'%')
- </if>
- AND a.websit_id = #{websitId}
- <if test="goodsType!=null and goodsType!=''">
- AND a.goods_type = #{goodsType}
- </if>
- <!-- AND a.qty > 0 -->
- GROUP BY a.goods_id
- LIMIT 100
- </select>
- <select id="notStockGoods" resultType="com.gree.mall.manager.bean.material.stock.WebsitSalesGoodsVO">
- SELECT
- b.goods_id,
- b.goods_name,
- b.market_price AS price,
- b.goods_code,
- b.goods_spell,
- b.goods_specification,
- b.goods_stock_unit,
- b.goods_sales_unit,
- b.brand_rela_name,
- b.product_rela_name,
- b.convert_bit_scale,
- b.goods_sales_convert_qty,
- b.manage_worker_stock,
- b.part_type,
- 0 AS qty
- FROM
- websit_goods b
- WHERE
- b.company_wechat_id = #{companyWechatId}
- <if test="goodsName!=null and goodsName!=''">
- AND b.goods_name LIKE CONCAT('%',#{goodsName},'%')
- </if>
- AND b.goods_type = #{goodsType}
- AND b.norm_type = 'M'
- </select>
- <select id="websitTradePage" resultType="com.gree.mall.manager.bean.material.manage.WebsitTradeVO">
- SELECT
- ${ex.selected}
- FROM websit_sales_pay_order 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="mAlonePage" resultType="com.gree.mall.manager.bean.material.base.WebsitGoodsAloneMVO">
- SELECT
- ${ex.selected}
- FROM websit_goods_alone a
- ${ex.query}
- AND a.goods_type = 'M'
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="pAlonePage" resultType="com.gree.mall.manager.bean.material.base.WebsitGoodsAlonePVO">
- SELECT
- ${ex.selected}
- FROM websit_goods_alone a
- ${ex.query}
- AND a.goods_type = 'P'
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="enginPayManageList" resultType="com.gree.mall.manager.bean.engin.EnginPayManageVO">
- SELECT
- ${ex.selected},
- IF((a.total_sales_amount - a.total_pay_amount) <![CDATA[ < ]]> 0, 0, (a.total_sales_amount - a.total_pay_amount)) AS totalNotPayAmount
- FROM engin_pay_manage 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="enginPayManageGatherList" resultType="com.gree.mall.manager.bean.engin.EnginPayManageGatherVO">
- SELECT
- ${ex.selected},
- SUM(a.total_sales_amount) AS totalSalesAmount,
- SUM(a.total_pay_amount) AS totalPayAmount,
- IF((SUM(a.total_sales_amount) - SUM(a.total_pay_amount)) <![CDATA[ < ]]> 0, 0, (SUM(a.total_sales_amount) - SUM(a.total_pay_amount))) AS totalNotPayAmount
- FROM engin_pay_manage 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>
- GROUP BY a.company_wechat_id, a.project_no
- </select>
- <select id="enginPayManageGatherLastUpdate" resultType="com.gree.mall.manager.bean.engin.EnginPayManageGatherVO">
- SELECT a.project_no, a.last_update_time, a.last_update_by
- FROM engin_pay_manage a
- INNER JOIN (SELECT project_no, MAX(last_update_time) AS max_time
- FROM engin_pay_manage
- WHERE
- company_wechat_id = #{companyWechatId}
- AND project_no IN
- <foreach item="item" index="index" collection="projectList" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- GROUP BY project_no) b
- ON a.project_no = b.project_no AND a.last_update_time = b.max_time AND a.company_wechat_id = #{companyWechatId}
- </select>
- <select id="exportWorkerMaterialRela"
- resultType="com.gree.mall.manager.bean.material.base.WorkerGoodsRelaExportBean">
- SELECT
- a.company_wechat_id,
- a.company_wechat_name,
- a.goods_category_name,
- a.goods_id,
- a.goods_name,
- a.is_small,
- a.status,
- b.goods_category_name AS websitCategoryName,
- b.websit_goods_id,
- b.websit_goods_name,
- c.goods_specification AS specification,
- c.goods_sales_convert_qty,
- c.manage_worker_stock,
- c.status AS websitGoodsStatus
- FROM
- worker_goods a
- LEFT JOIN worker_goods_rela b ON a.company_wechat_id = b.company_wechat_id AND a.goods_id = b.worker_goods_id
- LEFT JOIN websit_goods c ON a.company_wechat_id = c.company_wechat_id AND b.websit_goods_id = c.goods_id
- <where>
- <if test="companyWechatId != null and companyWechatId != ''">
- AND a.company_wechat_id = #{companyWechatId}
- </if>
- </where>
- </select>
- <select id="websitVenderGoodsPage"
- resultType="com.gree.mall.manager.bean.material.vender.WebsitVenderGoodsVO">
- SELECT
- ${ex.selected}
- FROM websit_vender_goods a
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="websitVenderGoodsRalaPage"
- resultType="com.gree.mall.manager.bean.material.vender.WebsitVenderGoodsRelaVO">
- SELECT
- ${ex.selected}
- FROM
- websit_vender_goods_rela a
- JOIN websit_goods b ON a.company_wechat_id = b.company_wechat_id AND a.goods_id = b.goods_id
- LEFT JOIN websit_goods_category c ON b.goods_category_id = c.category_id
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="websitPurchaseApplyPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPurchaseApplyVO">
- SELECT
- ${ex.selected}
- FROM
- websit_purchase 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>
- AND a.flag IN ('SAVE', 'SUBMIT')
- AND a.is_recheck = 'NO'
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="websitPurchaseCheckPage"
- resultType="com.gree.mall.manager.bean.material.vender.WebsitPurchaseCheckVO">
- SELECT
- ${ex.selected}
- FROM
- websit_purchase 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>
- AND a.flag IN ('SUBMIT', 'OK')
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="websitPurchaseOrderPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPurchaseOrderVO">
- SELECT
- ${ex.selected}
- FROM
- websit_purchase 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>
- AND a.flag IN ('SUBMIT', 'OK', 'CANCEL')
- AND a.is_recheck = 'YES'
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="websitPurchaseAdjustmentPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPurchaseAdjustmentVO">
- SELECT
- ${ex.selected}
- FROM
- websit_purchase_adjustment 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="websitPartsNewInPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsNewInVO">
- SELECT
- ${ex.selected}
- FROM
- websit_parts_new_in_record a
- ${ex.query}
- <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
- AND a.receive_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="websitPartsOldOutPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsOldOutVO">
- SELECT
- ${ex.selected}
- FROM
- websit_parts_old_out_record a
- ${ex.query}
- <if test="ex.receiveDate != null">
- AND a.receive_date IS NULL
- </if>
- <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
- AND a.send_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="websitWorkSettlementPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitWorkSettlementVO">
- SELECT
- ${ex.selected}
- FROM
- websit_parts_settlement_record a
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.import_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="websitPartsConfigPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsConfigVO">
- SELECT
- ${ex.selected}
- FROM
- websit_parts_refund_config a LEFT JOIN material_config b ON a.company_wechat_id = b.company_wechat_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="websitPartsSalesPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsSalesVO">
- SELECT
- ${ex.selected},
- CASE WHEN a.delivery_type = 0 AND a.buy_people = 'WORKER' AND a.websit_confirm_date IS NOT NULL THEN 1 ELSE 0 END AS deliveryConfirmFlag
- FROM
- websit_parts_sales a LEFT JOIN websit_parts_sales_item b ON a.id = b.sales_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="websitPartsSalesWPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsSalesWVO">
- SELECT
- ${ex.selected},
- CASE WHEN a.delivery_type = 0 AND a.buy_people = 'WORKER' AND a.websit_confirm_date IS NOT NULL THEN 1 ELSE 0 END AS deliveryConfirmFlag
- FROM
- websit_parts_sales 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="selectItemBySalesOrderId"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsSalesItemBean">
- select
- a.id ,
- a.identity ,
- a.websit_id,
- a.parts_websit_id,
- a.parts_id,
- a.parts_number,
- a.parts_name,
- a.material_group_name,
- a.goods_stock_unit,
- a.sales_id,
- a.sales_price,
- a.market_price,
- a.second_price,
- IF(d.status = 'END', a.examine_qty, a.qty) AS qty,
- a.examine_qty,
- a.new_refund_qty,
- a.old_refund_qty ,
- a.total_amount,
- a.push_flag ,
- a.create_by ,
- a.create_time,
- a.update_by,
- a.update_time,
- IFNULL(c.qty, 0) stockQty
- FROM websit_parts_sales_item a JOIN websit_goods b ON a.parts_id = b.goods_id
- LEFT JOIN websit_stock c ON a.websit_id = c.websit_id AND a.parts_number = c.goods_id AND a.parts_websit_id = c.parts_websit_id
- JOIN websit_parts_sales d ON a.sales_id = d.id
- WHERE a.sales_id = #{id}
- </select>
- <select id="queryOldRefundRecordById"
- resultType="com.gree.mall.manager.bean.material.worker.OldRefundManageRecordBean">
- SELECT
- a.*
- FROM
- websit_parts_old_refund_manage_record a
- WHERE
- sales_id = #{id}
- </select>
- <select id="newRefundManagePage"
- resultType="com.gree.mall.manager.bean.material.worker.NewRefundManageVO">
- SELECT
- ${ex.selected}
- FROM
- websit_parts_new_refund_manage a
- ${ex.query}
- <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
- AND a.receive_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="oldRefundManagePage" resultType="com.gree.mall.manager.bean.material.worker.OldRefundManageVO">
- SELECT
- ${ex.selected}
- FROM
- websit_parts_old_refund_manage a
- ${ex.query}
- <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
- AND a.receive_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="websitPurchaseChangeSalesPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsChangeSalesVO">
- SELECT
- ${ex.selected}
- FROM
- websit_parts_change_sales 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="websitPartsRefundRecordPage"
- resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsRefundRecordVO">
- SELECT
- ${ex.selected}
- FROM
- websit_parts_refund_record 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>
- </mapper>
|