DwssHwpGrindAndCutMapper.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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.DwssHwpGrindAndCutMapper">
  6. <resultMap id="BaseResultMap" type="com.zhgd.scs.domain.DwssHwpGrindAndCut">
  7. <id property="id" column="id" jdbcType="BIGINT"/>
  8. <result property="state" column="state" jdbcType="INTEGER"/>
  9. <result property="projectId" column="project_id" jdbcType="BIGINT"/>
  10. <result property="isOver" column="is_over" jdbcType="INTEGER"/>
  11. <result property="step1UserId" column="step1_user_id" jdbcType="BIGINT"/>
  12. <result property="step1Name" column="step1_name" jdbcType="VARCHAR"/>
  13. <result property="step1Time" column="step1_time" jdbcType="TIMESTAMP"/>
  14. <result property="step1WorkDate" column="step1_work_date" jdbcType="VARCHAR"/>
  15. <result property="step1Company" column="step1_company" jdbcType="VARCHAR"/>
  16. <result property="step1Location" column="step1_location" jdbcType="VARCHAR"/>
  17. <result property="step2Time" column="step2_time" jdbcType="TIMESTAMP"/>
  18. <result property="step2Check1" column="step2_check1" jdbcType="INTEGER"/>
  19. <result property="step2Check2" column="step2_check2" jdbcType="INTEGER"/>
  20. <result property="step2Check3" column="step2_check3" jdbcType="INTEGER"/>
  21. <result property="step2Check4" column="step2_check4" jdbcType="INTEGER"/>
  22. <result property="step2Check5" column="step2_check5" jdbcType="INTEGER"/>
  23. <result property="step2Check6" column="step2_check6" jdbcType="INTEGER"/>
  24. <result property="step2Check7" column="step2_check7" jdbcType="INTEGER"/>
  25. <result property="step2Check8" column="step2_check8" jdbcType="INTEGER"/>
  26. <result property="step2Check9" column="step2_check9" jdbcType="INTEGER"/>
  27. <result property="step2UserId" column="step2_user_id" jdbcType="BIGINT"/>
  28. <result property="step3Time" column="step3_time" jdbcType="TIMESTAMP"/>
  29. <result property="step3Name" column="step3_name" jdbcType="VARCHAR"/>
  30. <result property="step3Sign" column="step3_sign" jdbcType="VARCHAR"/>
  31. <result property="step3UserId" column="step3_user_id" jdbcType="BIGINT"/>
  32. <result property="step4Time" column="step4_time" jdbcType="TIMESTAMP"/>
  33. <result property="step4Check1" column="step4_check1" jdbcType="INTEGER"/>
  34. <result property="step4Check2" column="step4_check2" jdbcType="INTEGER"/>
  35. <result property="step4UserId" column="step4_user_id" jdbcType="BIGINT"/>
  36. <result property="step5Name" column="step5_name" jdbcType="VARCHAR"/>
  37. <result property="step5Sign" column="step5_sign" jdbcType="VARCHAR"/>
  38. <result property="step5Time" column="step5_time" jdbcType="TIMESTAMP"/>
  39. <result property="step5UserId" column="step5_user_id" jdbcType="BIGINT"/>
  40. </resultMap>
  41. <select id="unResolvedpage" resultType="com.zhgd.scs.domain.DwssHwpGrindAndCut">
  42. SELECT dc.*,
  43. du.id uid,
  44. du.hwp_id,
  45. du.user_id
  46. FROM `dwss_hwp_grind_and_cut` dc
  47. left join dwss_hwp_grind_and_cut_user_ref du on du.hwp_id = dc.id
  48. where dc.project_id = #{projectId}
  49. <if test="startDate!=null and endDate!=null">
  50. AND dc.step1_work_date BETWEEN #{startDate} AND #{endDate}
  51. </if>
  52. <if test="readId!=null">
  53. AND dc.id &lt; #{readId}
  54. </if>
  55. and(
  56. (dc.step1_user_id=#{userId} and(( dc.step2_user_id is null and dc.state=1) or(dc.step4_user_id is null and
  57. dc.state=3)))
  58. or
  59. (du.user_id=#{userId} and du.type =7 and ((dc.step3_user_id is null and dc.state =2) or (dc.step5_user_id is
  60. null and dc.state=5)))
  61. or
  62. (dc.is_over = 0 and (dc.step1_user_id=#{userId} or du.user_id = #{userId}))
  63. )
  64. GROUP BY dc.id
  65. order by dc.id desc
  66. </select>
  67. <select id="myResolvedpage" resultType="com.zhgd.scs.domain.DwssHwpGrindAndCut">
  68. SELECT dc.*,
  69. du.id uid,
  70. du.hwp_id,
  71. du.user_id
  72. FROM `dwss_hwp_grind_and_cut` dc
  73. left join dwss_hwp_grind_and_cut_user_ref du on du.hwp_id = dc.id
  74. where dc.project_id = #{projectId}
  75. <if test="startDate!=null and endDate!=null">
  76. AND dc.step1_work_date BETWEEN #{startDate} AND #{endDate}
  77. </if>
  78. <if test="readId!=null">
  79. AND dc.id &lt; #{readId}
  80. </if>
  81. and(
  82. (du.user_id=#{userId} and du.type =7 and ((dc.step3_user_id =#{userId} and dc.state !=5) or (dc.step5_user_id =#{userId})) and dc.step1_user_id != #{userId})
  83. or
  84. (dc.is_over = 1 and (dc.step1_user_id=#{userId} or du.user_id = #{userId}))
  85. )
  86. GROUP BY dc.id
  87. order by dc.id desc
  88. </select>
  89. <select id="getMyWoklistPage" resultType="com.zhgd.scs.domain.DwssHwpGrindAndCut">
  90. SELECT dc.*,
  91. u.id uid,
  92. u.hwp_id,
  93. u.user_id
  94. FROM dwss_hwp_grind_and_cut dc
  95. LEFT JOIN dwss_hwp_grind_and_cut_user_ref u on u.hwp_id = dc.id
  96. Where dc.project_id = #{projectId} and (dc.step1_user_id = #{userId} or u.user_id=#{userId})
  97. <if test="isOver!=null">
  98. and dc.is_over=#{isOver}
  99. </if>
  100. <if test="startDate!=null and endDate!=null">
  101. AND dc.step1_work_date BETWEEN #{startDate} AND #{endDate}
  102. </if>
  103. <if test="readId!=null">
  104. AND dc.id &lt; #{readId}
  105. </if>
  106. GROUP BY dc.id
  107. order by dc.id desc
  108. </select>
  109. </mapper>