| | |
| | | </sql> |
| | | <select id="fieldsStatics" resultType="com.ruoyi.system.vo.CurrentFieldsVO"> |
| | | SELECT |
| | | tbd.id, |
| | | su.area_name, |
| | | IF(tbd.`quarter` IS NULL, CONCAT(YEAR(NOW()), '年', |
| | | CASE |
| | |
| | | tbd.create_time, |
| | | COALESCE(tbd.`status`, 1) AS `status` |
| | | FROM |
| | | (SELECT * FROM sys_user WHERE user_type = 2) su |
| | | (SELECT * FROM sys_user WHERE user_type = 2) AS su |
| | | LEFT JOIN |
| | | (SELECT * FROM tb_basic_data WHERE `quarter` = #{nowQuarter}) tbd ON su.area_code = tbd.dept_area_code |
| | | (SELECT * FROM tb_basic_data WHERE `quarter` = #{dto.quarter}) AS tbd ON su.area_code = tbd.dept_area_code |
| | | <where> |
| | | <if test="nowQuarter != null and nowQuarter !=''"> |
| | | tbd.quarter LIKE CONCAT('%',#{nowQuarter},'%') |
| | | </if> |
| | | tbd.quarter = #{dto.quarter} |
| | | <if test="dto.areaName != null and dto.areaName !=''"> |
| | | su.area_name LIKE CONCAT('%',#{dto.areaName},'%') |
| | | AND su.area_name LIKE CONCAT('%',#{dto.areaName},'%') |
| | | </if> |
| | | <if test="dto.status != null and dto.status !=''"> |
| | | tbd.status = #{dto.status} |
| | | <if test="dto.status != null"> |
| | | AND tbd.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.personInCharge != null and dto.personInCharge !=''"> |
| | | su.person_in_charge LIKE CONCAT('%',#{dto.personInCharge},'%') |
| | | AND su.person_in_charge LIKE CONCAT('%',#{dto.personInCharge},'%') |
| | | </if> |
| | | <if test="dto.phoneNumber != null and dto.phoneNumber != ''"> |
| | | su.phone_number LIKE CONCAT('%',#{dto.phoneNumber},'%') |
| | | AND su.phone_number LIKE CONCAT('%',#{dto.phoneNumber},'%') |
| | | </if> |
| | | </where> |
| | | </select> |