| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?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.zhongzheng.modules.top.order.mapper.TopOrderAcceptanceMapper">
- <select id="queryAcceptanceList" parameterType="com.zhongzheng.modules.top.order.bo.TopOrderAcceptanceBo"
- resultType="com.zhongzheng.modules.top.order.vo.TopOrderAcceptanceVo">
- SELECT
- *
- FROM
- top_order_acceptance
- WHERE
- `status` = 1
- <if test="businessAffiliation != null and businessAffiliation != ''">
- AND business_affiliation = #{invoiceStatus}
- </if>
- <if test="incomeType != null and incomeType != ''">
- AND income_type = #{incomeType}
- </if>
- <if test="acceptanceType != null and acceptanceType != ''">
- AND acceptance_type = #{acceptanceType}
- </if>
- <if test="acceptanceStatus != null and acceptanceStatus != ''">
- AND acceptance_status = #{acceptanceStatus}
- </if>
- <if test="orderSn != null and orderSn != ''">
- AND acceptance_id IN (SELECT acceptance_id FROM top_order_acceptance_rel WHERE `status` = 1 AND order_sn = #{orderSn})
- </if>
- <if test="orderClient != null and orderClient != ''">
- AND order_client = #{orderClient}
- </if>
- <if test="incomeStartTime != null and incomeStartTime != ''">
- AND income_time <![CDATA[ >= ]]> #{incomeStartTime}
- </if>
- <if test="incomeEndTime != null and incomeEndTime != ''">
- AND income_time <![CDATA[ <= ]]> #{incomeEndTime}
- </if>
- ORDER BY create_time DESC
- </select>
- <select id="getAcceptanceOrderList" parameterType="com.zhongzheng.modules.top.order.bo.TopAcceptanceOrderBo"
- resultType="com.zhongzheng.modules.top.goods.vo.TopOldOrderVo">
- SELECT
- * ,
- (SELECT st.tenant_name FROM sys_tenant st WHERE st.tenant_id = t.tenant_id) AS tenant_name
- FROM
- top_old_order t
- WHERE
- t.`status` = 1
- AND t.check_status = 1
- <if test="orderSign != null and orderSign != '' and orderSign == 1">
- AND t.order_uncollected > 0
- </if>
- <if test="orderSn != null and orderSn != ''">
- AND t.order_sn = #{orderSn}
- </if>
- <if test="orderSnList != null and orderSnList.size()!=0 ">
- AND t.order_sn in
- <foreach collection="orderSnList" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="createNo != null and createNo != ''">
- AND t.create_no = #{createNo}
- </if>
- <if test="purchaseOrg != null and purchaseOrg != ''">
- AND t.purchase_org = #{purchaseOrg}
- </if>
- <if test="userKey != null and userKey != ''">
- AND (
- SELECT
- COUNT( DISTINCT tog.order_goods_id )
- FROM
- top_old_order_goods tog
- WHERE
- tog.order_sn = t.order_sn
- AND tog.`status` = 1
- AND tog.check_status = 1
- AND ( tog.user_name = #{userKey} OR tog.user_card = #{userKey,typeHandler=com.zhongzheng.common.type.EncryptHandler} )) > 0
- </if>
- ORDER BY t.create_time DESC
- </select>
- </mapper>
|