| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <?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.settle.mapper.TopInstSettleMapper">
- <select id="getOrderInfo" parameterType="java.lang.String" resultType="com.zhongzheng.modules.top.settle.vo.TopOrderInfoVo">
- SELECT
- order_sn,
- create_no,
- create_username,
- purchase_org AS clientName,
- order_from,
- check_status
- FROM
- v_top_order
- WHERE
- order_sn = #{orderSn}
- </select>
- <select id="getOrderBusiness" parameterType="java.lang.String" resultType="java.lang.String">
- SELECT
- business_full_name
- FROM
- v_top_order_business
- WHERE
- order_sn = #{orderSn}
- </select>
- <select id="geTopCostBusinessName" parameterType="java.lang.Long" resultType="java.lang.String">
- SELECT CONCAT(( SELECT education_name FROM top_course_education_type WHERE id = ct.education_type_id ),
- ( SELECT business_name FROM top_course_business WHERE id = ct.business_id ),
- ( SELECT project_name FROM top_course_project_type WHERE id = ct.project_id )
- )
- FROM
- top_cost_inst_tp_item ct
- WHERE
- ct.id = #{id}
- </select>
- <select id="getGoodsBusinessNameList" parameterType="com.zhongzheng.modules.order.bo.OrderBusinessBo" resultType="java.lang.String">
- SELECT business_name FROM v_top_order_business WHERE 1=1
- <if test="orderSn != null and orderSn != ''">
- AND order_sn = #{orderSn}
- </if>
- <if test="orderGoodsId != null and orderGoodsId != ''">
- AND order_goods_id = #{orderGoodsId}
- </if>
- </select>
- <select id="getGoodsBusinessName" parameterType="map" resultType="java.lang.String">
- SELECT business_full_name FROM v_top_order_business WHERE order_goods_id = #{orderGoodsId} AND order_sn = #{orderSn}
- </select>
- <select id="getOrderGoodsByBusiness" parameterType="map" resultType="java.lang.Long">
- SELECT order_goods_id FROM v_top_order_business WHERE order_sn = #{orderSn} AND INSTR(business_full_name,#{tpBusinessName})
- </select>
- <select id="getSettleList" parameterType="com.zhongzheng.modules.top.settle.bo.SettleQueryBo" resultType="com.zhongzheng.modules.top.settle.vo.SettleVo">
- SELECT
- tis.settle_id,
- tis.settle_sn,
- tis.create_time,
- tis.title,
- tis.remark,
- tis.settle_type,
- tis.education_type_id,
- tis.project_id,
- tis.business_id,
- tis.settle_money,
- tis.create_user_id,
- tis.inst_id,
- ti.inst_name,
- ti.bank,
- ti.bank_name,
- ti.bank_account,
- tis.check_status,
- tis.`status`,
- tic.cost_cat_id,
- tic.category_name as costCatName,
- cet.education_name,
- CONCAT(cb.business_name,cpt.project_name) AS business_name
- FROM
- top_inst_settle tis
- LEFT JOIN top_course_education_type cet ON tis.education_type_id = cet.id
- LEFT JOIN top_course_project_type cpt ON tis.project_id = cpt.id
- LEFT JOIN top_course_business cb ON tis.business_id = cb.id
- LEFT JOIN top_institution ti ON tis.inst_id = ti.inst_id
- LEFT JOIN top_inst_category tic ON tis.cost_cat_id = tic.cost_cat_id
- WHERE
- tis.`status` != - 1
- <if test="settleType != null and settleType != ''">
- AND tis.settle_type = #{settleType}
- </if>
- <if test="costCatId != null and costCatId != ''">
- AND tis.cost_cat_id = #{costCatId}
- </if>
- <if test="educationTypeId != null and educationTypeId != ''">
- AND tis.education_type_id = #{educationTypeId}
- </if>
- <if test="businessId != null and businessId != ''">
- AND tis.business_id = #{businessId}
- </if>
- <if test="checkStatus != null and checkStatus != ''and checkStatus == 7">
- AND tis.check_status = 2
- AND ((SELECT tcl.role_id FROM top_old_order_check_log tcl
- WHERE tis.settle_sn = tcl.order_sn AND tcl.check_sign = 1 AND tcl.`status` = 1 LIMIT 1) IN
- <foreach collection="roleIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>)
- </if>
- <if test="checkStatus != null and checkStatus != '' and checkStatus != 7">
- AND tis.check_status = #{checkStatus}
- </if>
- <if test="startTime != null and startTime != ''">
- AND tis.create_time >= #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- AND tis.create_time <= #{endTime}
- </if>
- <if test="title != null and title != ''">
- AND tis.title LIKE concat('%', #{title}, '%')
- </if>
- ORDER BY tis.create_time DESC
- </select>
- <select id="getSettleByBusiness" parameterType="map" resultType="com.zhongzheng.modules.top.settle.domian.TopInstSettle">
- SELECT
- tis.*
- FROM
- top_inst_settle tis
- LEFT JOIN top_course_education_type cet ON tis.education_type_id = cet.id
- LEFT JOIN top_course_project_type cpt ON tis.project_id = cpt.id
- LEFT JOIN top_course_business cb ON tis.business_id = cb.id
- WHERE
- tis.`status` = 1
- AND tis.check_status = 6
- AND settle_type = 2
- AND tis.sign_start_time <= #{signTime} AND tis.sign_end_time >= #{signTime}
- AND INSTR(
- #{businessName},
- CONCAT( cet.education_name, cb.business_name, cpt.project_name )) > 0
- AND (tis.settle_order_type = 3 OR tis.settle_order_type = #{settleOrderType})
- </select>
- </mapper>
|