| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?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.crm.custom.dao.mapper.GoldenOrderMapper">
- <select id="countList" resultType="integer"
- parameterType="com.crm.rely.backend.model.entity.golden.order.GoldenOrderSearchEntity">
- select count(*) from golden_order der
- <where>
- <if test="customId!=null">
- and der.`custom_id` = #{customId}
- </if>
- <if test="cId!=null">
- and der.`c_id` = #{cId}
- </if>
- <if test="status!=null">
- and der.`c_id` = #{status}
- </if>
- <if test="serial!=null and serial!=''">
- and der.serial = #{serial}
- </if>
- <if test="channelCode!=null and channelCode!=''">
- and der.channel_code = #{channelCode}
- </if>
- <if test="payName!=null and payName!=''">
- and der.pay_name like concat('%',#{payName},'%')
- </if>
- <if test="startDate != null">
- and der.add_time <![CDATA[ >= ]]> #{startDate}
- </if>
- <if test="endDate != null">
- and der.add_time <![CDATA[ <= ]]> #{endDate}
- </if>
- </where>
- </select>
- <select id="pageList" resultType="com.crm.rely.backend.model.pojo.table.GoldenOrderTable"
- parameterType="com.crm.rely.backend.model.entity.golden.order.GoldenOrderSearchEntity">
- select * from golden_order der
- <where>
- <if test="customId!=null">
- and der.`custom_id` = #{customId}
- </if>
- <if test="cId!=null">
- and der.`c_id` = #{cId}
- </if>
- <if test="status!=null">
- and der.`c_id` = #{status}
- </if>
- <if test="serial!=null and serial!=''">
- and der.serial = #{serial}
- </if>
- <if test="channelCode!=null and channelCode!=''">
- and der.channel_code = #{channelCode}
- </if>
- <if test="payName!=null and payName!=''">
- and der.pay_name like concat('%',#{payName},'%')
- </if>
- <if test="startDate != null">
- and der.add_time <![CDATA[ >= ]]> #{startDate}
- </if>
- <if test="endDate != null">
- and der.add_time <![CDATA[ <= ]]> #{endDate}
- </if>
- </where>
- order by id desc
- <if test="page != null">
- limit #{page.offset},#{page.row}
- </if>
- </select>
- <select id="getListBySerial" resultType="com.crm.rely.backend.model.dto.golden.order.GoldenOrderDetailsDto">
- SELECT *
- FROM golden_order_details
- where serial in
- <foreach collection="serialList" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- <select id="getByCustomIdAndGoodsId" resultType="com.crm.rely.backend.model.pojo.table.GoldenOrderDetailsTable">
- SELECT *
- FROM golden_order_details der
- left join golden_order gor on der.serial = gor.serial
- where gor.`status` in (1,2) and der.custom_id = #{customId}
- and der.goods_id = #{goodsId} limit 1
- </select>
- </mapper>
|