123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <?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.platform.dao.mapper.preparation.PreparationMapper">
- <sql id="Base_Column_List">
- preparation.id,
- preparation.position_id,
- preparation.user_id,
- preparation.depart_id,
- preparation.apply_time,
- preparation.content,
- preparation.status,
- preparation.remark,
- preparation.created_time,
- preparation.update_time,
- preparation.created_user_id,
- preparation.created_user_name,
- preparation.update_user_id,
- preparation.update_user_name,
- preparation.repair_start_time,
- preparation.repair_end_time,
- preparation.repair_minutes,
- preparation.repair_user_id,
- preparation.repair_content,
- preparation.limit_hours,
- preparation.fee,
- preparation.fee_file
- </sql>
- <sql id="Ref_Column_List">
- preparation.position_id,
- preparation.user_id,
- preparation.depart_id,
- preparation.apply_time,
- preparation.content,
- preparation.status,
- preparation.remark,
- preparation.repair_start_time,
- preparation.repair_end_time,
- preparation.repair_minutes,
- preparation.repair_user_id,
- preparation.repair_content,
- preparation.limit_hours,
- preparation.fee,
- preparation.fee_file
- </sql>
- <sql id="List_Condition">
- <if test="id != null and id != ''">
- and preparation.id = #{id}
- </if>
- <if test="positionId != null and positionId != ''">
- and preparation.position_id = #{positionId}
- </if>
- <if test="applyVerifyUserId != null and applyVerifyUserId != ''">
- and (preparation.user_id = #{applyVerifyUserId} or preparation.apply_verify_user_id = #{applyVerifyUserId})
- </if>
- <if test="userId != null and userId != ''">
- and preparation.user_id = #{userId}
- </if>
- <if test="departId != null and departId != ''">
- and preparation.depart_id = #{departId}
- </if>
- <if test="applyTimeStart != null">
- and preparation.apply_time <![CDATA[>=]]> #{applyTimeStart}
- </if>
- <if test="applyTimeEnd != null">
- and preparation.apply_time <![CDATA[<=]]> #{applyTimeEnd}
- </if>
- <if test="applyTime != null">
- and preparation.apply_time = #{applyTime}
- </if>
- <if test="content != null and content != ''">
- and preparation.content = #{content}
- </if>
- <if test="status != null">
- and preparation.status = #{status}
- </if>
- <if test="remark != null and remark != ''">
- and preparation.remark = #{remark}
- </if>
- <if test="createdTimeStart != null">
- and preparation.created_time <![CDATA[>=]]> #{createdTimeStart}
- </if>
- <if test="createdTimeEnd != null">
- and preparation.created_time <![CDATA[<=]]> #{createdTimeEnd}
- </if>
- <if test="createdTime != null">
- and preparation.created_time = #{createdTime}
- </if>
- <if test="updateTimeStart != null">
- and preparation.update_time <![CDATA[>=]]> #{updateTimeStart}
- </if>
- <if test="updateTimeEnd != null">
- and preparation.update_time <![CDATA[<=]]> #{updateTimeEnd}
- </if>
- <if test="updateTime != null">
- and preparation.update_time = #{updateTime}
- </if>
- <if test="createdUserId != null and createdUserId != ''">
- and preparation.created_user_id = #{createdUserId}
- </if>
- <if test="createdUserName != null and createdUserName != ''">
- and preparation.created_user_name = #{createdUserName}
- </if>
- <if test="updateUserId != null and updateUserId != ''">
- and preparation.update_user_id = #{updateUserId}
- </if>
- <if test="updateUserName != null and updateUserName != ''">
- and preparation.update_user_name = #{updateUserName}
- </if>
- <if test="repairStartTimeStart != null">
- and preparation.repair_start_time <![CDATA[>=]]> #{repairStartTimeStart}
- </if>
- <if test="repairStartTimeEnd != null">
- and preparation.repair_start_time <![CDATA[<=]]> #{repairStartTimeEnd}
- </if>
- <if test="repairStartTime != null">
- and preparation.repair_start_time = #{repairStartTime}
- </if>
- <if test="repairEndTimeStart != null">
- and preparation.repair_end_time <![CDATA[>=]]> #{repairEndTimeStart}
- </if>
- <if test="repairEndTimeEnd != null">
- and preparation.repair_end_time <![CDATA[<=]]> #{repairEndTimeEnd}
- </if>
- <if test="repairEndTime != null">
- and preparation.repair_end_time = #{repairEndTime}
- </if>
- <if test="repairMinutes != null">
- and preparation.repair_minutes = #{repairMinutes}
- </if>
- <if test="repairUserId != null and repairUserId != ''">
- and (preparation.user_id = #{repairUserId} or preparation.repair_user_id = #{repairUserId})
- </if>
- <if test="repairContent != null and repairContent != ''">
- and preparation.repair_content = #{repairContent}
- </if>
- <if test="limitHoursStart != null">
- and preparation.limit_hours <![CDATA[>=]]> #{limitHoursStart}
- </if>
- <if test="limitHoursEnd != null">
- and preparation.limit_hours <![CDATA[<=]]> #{limitHoursEnd}
- </if>
- <if test="limitHours != null">
- and preparation.limit_hours = #{limitHours}
- </if>
- <if test="fee != null">
- and preparation.fee = #{fee}
- </if>
- <if test="feeFile != null and feeFile != ''">
- and preparation.fee_file = #{feeFile}
- </if>
- <if test="keyword != null and keyword != ''">
- and preparation.id like concat(concat('%',#{keyword}),'%')
- </if>
- <!-- 新增查询参数 -->
- <if test="statusList != null and statusList.size > 0">
- AND preparation.status in
- <foreach item="item" index="index" collection="statusList" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="tempUserId != null and tempUserId != ''">
- and (preparation.user_id = #{tempUserId} or preparation.receive_verify_leader = #{tempUserId}
- or preparation.apply_verify_leader = #{tempUserId})
- </if>
- <if test="delUserId != null and delUserId != ''">
- and preparation.del_user_id not like concat(concat('%',#{delUserId}),'%')
- </if>
- </sql>
- <select id="selectList" parameterType="com.platform.dao.dto.preparation.PreparationDTO"
- resultType="com.platform.dao.vo.query.preparation.PreparationVO">
- select preparation.*,applyU.real_name as userName,sp.name as positionName,dept.name as deptName,psp.name as parentPositionName
- from t_preparation as preparation join t_sys_user applyU on preparation.user_id = applyU.user_id
- join t_building sp on preparation.position_id = sp.id
- left join t_building psp on psp.id = preparation.parent_position_id
- join t_sys_dept dept on preparation.depart_id = dept.dept_id
- <where>
- <include refid="List_Condition"/>
- </where>
- </select>
- <select id="getPreparationReportByStatusVO" resultType="com.platform.dao.vo.report.PreparationReportByStatusVO"
- parameterType="com.platform.dao.dto.preparation.PreparationDTO">
- select preparation.status,count(1) as num
- from t_preparation as preparation join t_sys_user applyU on preparation.user_id = applyU.user_id
- join t_building sp on preparation.position_id = sp.id
- join t_sys_dept dept on preparation.depart_id = dept.dept_id
- <where>
- <include refid="List_Condition"/>
- </where>
- group by status
- </select>
- <select id="getCountByUserId" resultType="com.platform.dao.vo.query.preparation.PreparationVO"
- parameterType="com.platform.dao.dto.preparation.PreparationDTO">
- select status, count(1) counts from t_preparation
- <where>
- <if test="applyVerifyUserId != null and applyVerifyUserId != ''">
- and (user_id = #{applyVerifyUserId} or apply_verify_user_id = #{applyVerifyUserId})
- </if>
- <if test="userId !=null and userId !='' ">
- and user_id = #{userId}
- </if>
- <if test="repairUserId!=null and repairUserId!=''">
- and (user_id = #{repairUserId} or repair_user_id = #{repairUserId})
- </if>
- <if test="tempUserId != null and tempUserId != ''">
- and (user_id = #{tempUserId} or receive_verify_leader = #{tempUserId}
- or apply_verify_leader = #{tempUserId})
- </if>
- <if test="delUserId != null and delUserId != ''">
- and del_user_id not like concat(concat('%',#{delUserId}),'%')
- </if>
- </where>
- group by status
- </select>
- </mapper>
|