DigitalWorklistMapper.xml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhgd.scs.mapper.DigitalWorklistMapper">
  6. <resultMap id="BaseResultMap" type="com.zhgd.scs.domain.DigitalWorklist">
  7. <id property="id" column="id" jdbcType="BIGINT"/>
  8. <result property="createdDate" column="created_date" jdbcType="TIMESTAMP"/>
  9. <result property="createdPerson" column="created_person" jdbcType="BIGINT"/>
  10. <result property="supervisor" column="supervisor" jdbcType="BIGINT"/>
  11. <result property="approvePerson" column="approve_person" jdbcType="BIGINT"/>
  12. <result property="startDate" column="start_date" jdbcType="VARCHAR"/>
  13. <result property="endDate" column="end_date" jdbcType="VARCHAR"/>
  14. <result property="content" column="content" jdbcType="VARCHAR"/>
  15. <result property="typeId" column="type_id" jdbcType="BIGINT"/>
  16. <result property="state" column="state" jdbcType="INTEGER"/>
  17. <result property="projectId" column="project_id" jdbcType="BIGINT"/>
  18. <result property="examineContent" column="examine_content" jdbcType="VARCHAR"/>
  19. <result property="ispass" column="ispass" jdbcType="INTEGER"/>
  20. </resultMap>
  21. <select id="pagelist" resultType="com.zhgd.scs.domain.vo.DigitalWorklistVo">
  22. SELECT w.*,sp.name supervisorName,u.real_name approvePersonName , wt.name typeName, lu.abbr_name unitName,wp.stc_due_date
  23. FROM digital_worklist w
  24. left join labor_person sp on sp.id=w.supervisor
  25. left join sys_user u on u.id=w.approve_person
  26. left join digital_work_type wt on wt.id = w.type_id
  27. left join labor_person wp on wp.id = w.created_person
  28. left join labor_unit lu on lu.id=wp.unit_id
  29. WHERE w.project_id = #{projectId}
  30. <if test="startDate!= null and endDate!= null ">
  31. 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})
  32. </if>
  33. <if test="typeId!= null">
  34. AND w.type_id = #{typeId}
  35. </if>
  36. <if test="state!= null">
  37. AND w.state = #{state}
  38. </if>
  39. <if test="validState!= null">
  40. AND w.valid_state = #{validState}
  41. </if>
  42. <if test="name!=null and name!= ''">
  43. AND w.created_person_name LIKE concat('%',#{name},'%')
  44. </if>
  45. <if test="worklistId!= null">
  46. AND w.id &lt; #{worklistId}
  47. </if>
  48. <if test="isEnd!= null">
  49. AND w.is_end = #{isEnd}
  50. </if>
  51. <if test="createdPerson!= null">
  52. AND w.created_person = #{createdPerson}
  53. </if>
  54. <if test="approvePerson!= null">
  55. AND w.approve_person = #{approvePerson}
  56. </if>
  57. <if test="allPerson!= null">
  58. AND( w.created_person = #{allPerson} or w.approve_person = #{allPerson})
  59. </if>
  60. ORDER BY id DESC -- 然后按 time 倒序排序
  61. </select>
  62. </mapper>