WorkInspectionApplicationMapper.xml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.WorkInspectionApplicationMapper">
  6. <resultMap id="BaseResultMap" type="com.zhgd.scs.domain.WorkInspectionApplication">
  7. <id property="id" column="id" jdbcType="BIGINT"/>
  8. <result property="project" column="project" jdbcType="VARCHAR"/>
  9. <result property="contractNo" column="contract_no" jdbcType="VARCHAR"/>
  10. <result property="contractor" column="contractor" jdbcType="VARCHAR"/>
  11. <result property="sketchNo" column="sketch_no" jdbcType="VARCHAR"/>
  12. <result property="serialNo" column="serial_no" jdbcType="VARCHAR"/>
  13. <result property="designation" column="designation" jdbcType="VARCHAR"/>
  14. <result property="clerks" column="clerks" jdbcType="VARCHAR"/>
  15. <result property="approverId" column="approver_id" jdbcType="BIGINT"/>
  16. <result property="approver" column="approver" jdbcType="VARCHAR"/>
  17. <result property="location" column="location" jdbcType="VARCHAR"/>
  18. <result property="description" column="description" jdbcType="VARCHAR"/>
  19. <result property="proposed" column="proposed" jdbcType="VARCHAR"/>
  20. <result property="workIsFound" column="work_is_found" jdbcType="INTEGER"/>
  21. <result property="isPermission" column="is_permission" jdbcType="INTEGER"/>
  22. <result property="reasons" column="reasons" jdbcType="VARCHAR"/>
  23. <result property="state" column="state" jdbcType="INTEGER"/>
  24. </resultMap>
  25. <select id="unResolvedpage" resultType="com.zhgd.scs.domain.WorkInspectionApplication">
  26. SELECT a.*
  27. FROM work_inspection_application a
  28. <if test="type == 5">
  29. LEFT JOIN work_inspection_application_user_ref u on u.user_id = #{inspectorId}
  30. </if>
  31. <if test="type == 6">
  32. LEFT JOIN work_inspection_application_user_ref u on u.user_id = #{approverId}
  33. </if>
  34. Where a.project_id = #{projectId}
  35. <if test="type == 5">
  36. and a.inspector_id is null
  37. </if>
  38. <if test="type == 6">
  39. and a.approver_id is null
  40. </if>
  41. <if test="startDate!=null and endDate!=null and startDate != '' and endDate != ''">
  42. AND a.applicant_date BETWEEN #{startDate} AND #{endDate}
  43. </if>
  44. <if test="readId!=null">
  45. AND a.id &lt; #{readId}
  46. </if>
  47. GROUP BY a.id
  48. order by a.id desc
  49. </select>
  50. <select id="getMyWoklistPage" resultType="com.zhgd.scs.domain.WorkInspectionApplication">
  51. SELECT a.*
  52. FROM work_inspection_application a
  53. LEFT JOIN work_inspection_application_user_ref u on u.user_id = #{userId}
  54. Where a.project_id = #{projectId}
  55. <if test="isOver!=null">
  56. and a.is_over=#{isOver}
  57. </if>
  58. <if test="startDate!=null and endDate!=null and startDate != '' and endDate != ''">
  59. AND a.applicant_date BETWEEN #{startDate} AND #{endDate}
  60. </if>
  61. <if test="readId!=null">
  62. AND a.id &lt; #{readId}
  63. </if>
  64. GROUP BY a.id
  65. order by a.id desc
  66. </select>
  67. </mapper>