| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.gkhy.exam.noncoalmine.mapper.ViolationRegistrationMapper"> |
| | | <select id="listByPage" resultType="com.gkhy.exam.noncoalmine.entity.TrainingInstitution"> |
| | | select |
| | | violation_id, |
| | | name, |
| | | id_card, |
| | | elect_num, |
| | | ic_num, |
| | | violation_time, |
| | | dept, |
| | | operate_type_id, |
| | | is_cm, |
| | | violation_path, |
| | | remark, |
| | | del_flag, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time |
| | | from violation_registration |
| | | where del_flag = 0 |
| | | <if test="query.dept != null and query.dept = ''"> |
| | | and dept like concat('%', #{query.dept}, '%') |
| | | <mapper namespace="com.gkhy.exam.noncoalmine.mapper.TrainingInstitutionMapper"> |
| | | <select id="listByPage" resultType="com.gkhy.exam.noncoalmine.model.vo.TrainingInstitutionVO"> |
| | | SELECT |
| | | t.*, |
| | | d.name as districtName |
| | | FROM |
| | | training_institution t |
| | | LEFT JOIN sys_district d ON d.id = t.district_id |
| | | WHERE |
| | | t.del_flag = 0 |
| | | <if test="query.institutionName != null and query.institutionName = ''"> |
| | | and t.institution_name like concat('%', #{query.institutionName}, '%') |
| | | </if> |
| | | <if test="query.name != null and query.name = ''"> |
| | | and name like concat('%', #{query.name}, '%') |
| | | <if test="query.districtCode != null and query.districtCode = ''"> |
| | | AND d.`code` LIKE concat(#{query.districtCode}, '%') |
| | | </if> |
| | | <if test="query.idCard != null and query.idCard = ''"> |
| | | and id_card like concat('%', #{query.idCard}, '%') |
| | | <if test="query.isCm != null and query.isCm = ''"> |
| | | AND t.is_cm = #{query.isCm} |
| | | </if> |
| | | <if test="query.operateTypeId != null and query.operateTypeId != 0"> |
| | | and (operate_type_id = #{query.operateTypeId} OR operate_type_id IN ( SELECT t.id FROM sys_operate_type t WHERE find_in_set(#{query.operateTypeId}, ancestors))) |
| | | </if> |
| | | order by create_time desc |
| | | order by t.create_time desc |
| | | |
| | | </select> |
| | | </mapper> |