|
|
@@ -103,6 +103,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
order by card_id desc
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectDzCardsList2" parameterType="DzCards" resultMap="DzCardsResult">
|
|
|
+ select c.card_id, card_no, c.password, c.type, c.status, distribute_status, time_status, pay_status, is_settlement, c.dept_id, agent_id, leaf_agent_id, campus_id, campus_class_id, assign_location,assign_exam_type,assign_school_id, school_id, class_id, c.year, c.end_year, open_id, c.remark, distribute_time, out_date, open_time, pay_time, active_time, days, settlement_time, refund_time, close_time, c.create_time, c.update_time
|
|
|
+ from dz_cards c left join sys_user u on c.`card_id` = u.`card_id`
|
|
|
+ <where>
|
|
|
+ <if test="cardNo != null and cardNo != ''"> and c.card_no = #{cardNo}</if>
|
|
|
+ <if test="password != null and password != ''"> and c.password = #{password}</if>
|
|
|
+ <if test="type != null "> and c.type = #{type}</if>
|
|
|
+ <if test="status != null "> and c.status = #{status}</if>
|
|
|
+ <if test="distributeStatus != null "> and distribute_status = #{distributeStatus}</if>
|
|
|
+ <if test="timeStatus != null "> and time_status = #{timeStatus}</if>
|
|
|
+ <if test="payStatus != null "> and pay_status = #{payStatus}</if>
|
|
|
+ <if test="isSettlement != null "> and is_settlement = #{isSettlement}</if>
|
|
|
+ <if test="deptId != null ">
|
|
|
+ AND (c.dept_id = #{deptId} OR c.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
|
|
+ </if>
|
|
|
+ <if test="agentId != null ">
|
|
|
+ AND (agent_id = #{agentId} OR agent_id IN ( SELECT t.agent_id FROM dz_agent t WHERE t.agent_id=#{agentId} ))
|
|
|
+ </if>
|
|
|
+ <if test="leafAgentId != null "> and c.leaf_agent_id = #{leafAgentId}</if>
|
|
|
+ <if test="campusId != null "> and c.campus_id = #{campusId}</if>
|
|
|
+ <if test="campusClassId != null "> and c.campus_class_id = #{campusClassId}</if>
|
|
|
+ <if test="assignLocation != null "> and c.assign_location = #{assignLocation}</if>
|
|
|
+ <if test="assignExamType != null "> and c.assign_exam_type = #{assignExamType}</if>
|
|
|
+ <if test="assignSchoolId != null "> and c.assign_school_id = #{assignSchoolId}</if>
|
|
|
+ <if test="examType != null "> and u.exam_type = #{examType}</if>
|
|
|
+ <if test="phonenumber != null "> and u.phonenumber = #{phonenumber}</if>
|
|
|
+ <if test="nickName != null "> and u.nick_name like concat('%', #{nickName}, '%')</if>
|
|
|
+ <if test="schoolId != null "> and c.school_id = #{schoolId}</if>
|
|
|
+ <if test="classId != null "> and c.class_id = #{classId}</if>
|
|
|
+ <if test="year != null "> and c.year = #{year}</if>
|
|
|
+ <if test="endYear != null "> and c.end_year = #{endYear}</if>
|
|
|
+ <if test="openId != null "> and open_id = #{openId}</if>
|
|
|
+ <if test="distributeTime != null "> and distribute_time = #{distributeTime}</if>
|
|
|
+ <if test="outDate != null "> and out_date = #{outDate}</if>
|
|
|
+ <if test="openTime != null "> and open_time = #{openTime}</if>
|
|
|
+ <if test="payTime != null "> and pay_time = #{payTime}</if>
|
|
|
+ <if test="activeTime != null "> and active_time = #{activeTime}</if>
|
|
|
+ <if test="settlementTime != null "> and settlement_time = #{settlementTime}</if>
|
|
|
+ <if test="refundTime != null "> and refund_time = #{refundTime}</if>
|
|
|
+ <if test="closeTime != null "> and close_time = #{closeTime}</if>
|
|
|
+ <if test="begin != null "> and card_no >= #{begin}</if>
|
|
|
+ <if test="end != null "> and card_no <= #{end}</if>
|
|
|
+ <if test="assignTimeBegin != null "> and date(distribute_time) >= date(#{assignTimeBegin})</if>
|
|
|
+ <if test="assignTimeEnd != null "> and date(distribute_time) <= date(#{assignTimeEnd})</if>
|
|
|
+
|
|
|
+ <!-- 根据统计类型添加条件 -->
|
|
|
+ <if test="statisticsType != null and statisticsType == 'openCard'">
|
|
|
+ AND (c.status = 10 OR c.status = 20 OR c.status = 30)
|
|
|
+ </if>
|
|
|
+ <if test="statisticsType != null and statisticsType == 'closeCard'">
|
|
|
+ AND distribute_status = 30
|
|
|
+ </if>
|
|
|
+ <if test="statisticsType != null and statisticsType == 'payCard'">
|
|
|
+ AND pay_status = 20
|
|
|
+ </if>
|
|
|
+ <if test="statisticsType != null and statisticsType == 'settlementCard'">
|
|
|
+ AND is_settlement = 1
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by card_id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectDzCardsByCardId" parameterType="Long" resultMap="DzCardsResult">
|
|
|
<include refid="selectDzCardsVo"/>
|
|
|
where card_id = #{cardId}
|