1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?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.zhgd.scs.mapper.DigitalWorklistMapper">
- <resultMap id="BaseResultMap" type="com.zhgd.scs.domain.DigitalWorklist">
- <id property="id" column="id" jdbcType="BIGINT"/>
- <result property="createdDate" column="created_date" jdbcType="TIMESTAMP"/>
- <result property="createdPerson" column="created_person" jdbcType="BIGINT"/>
- <result property="supervisor" column="supervisor" jdbcType="BIGINT"/>
- <result property="approvePerson" column="approve_person" jdbcType="BIGINT"/>
- <result property="startDate" column="start_date" jdbcType="VARCHAR"/>
- <result property="endDate" column="end_date" jdbcType="VARCHAR"/>
- <result property="content" column="content" jdbcType="VARCHAR"/>
- <result property="typeId" column="type_id" jdbcType="BIGINT"/>
- <result property="state" column="state" jdbcType="INTEGER"/>
- <result property="projectId" column="project_id" jdbcType="BIGINT"/>
- <result property="examineContent" column="examine_content" jdbcType="VARCHAR"/>
- <result property="ispass" column="ispass" jdbcType="INTEGER"/>
- </resultMap>
- <select id="pagelist" resultType="com.zhgd.scs.domain.vo.DigitalWorklistVo">
- SELECT w.*,sp.name supervisorName,u.real_name approvePersonName , wt.name typeName, lu.abbr_name unitName,wp.stc_due_date
- FROM digital_worklist w
- left join labor_person sp on sp.id=w.supervisor
- left join sys_user u on u.id=w.approve_person
- left join digital_work_type wt on wt.id = w.type_id
- left join labor_person wp on wp.id = w.created_person
- left join labor_unit lu on lu.id=wp.unit_id
- WHERE w.project_id = #{projectId}
- <if test="startDate!= null and endDate!= null ">
- AND (STR_TO_DATE(CONCAT(w.end_date, ' 23:59:59'), '%Y-%m-%d %H:%i:%s') between #{startDate} AND #{endDate} or w.start_date between #{startDate} AND #{endDate})
- </if>
- <if test="typeId!= null">
- AND w.type_id = #{typeId}
- </if>
- <if test="state!= null">
- AND w.state = #{state}
- </if>
- <if test="validState!= null">
- AND w.valid_state = #{validState}
- </if>
- <if test="name!=null and name!= ''">
- AND w.created_person_name LIKE concat('%',#{name},'%')
- </if>
- <if test="worklistId!= null">
- AND w.id < #{worklistId}
- </if>
- <if test="isEnd!= null">
- AND w.is_end = #{isEnd}
- </if>
- <if test="createdPerson!= null">
- AND w.created_person = #{createdPerson}
- </if>
- <if test="approvePerson!= null">
- AND w.approve_person = #{approvePerson}
- </if>
- <if test="allPerson!= null">
- AND( w.created_person = #{allPerson} or w.approve_person = #{allPerson})
- </if>
- ORDER BY id DESC -- 然后按 time 倒序排序
- </select>
- </mapper>
|