123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?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.DwssHwpGrindAndCutMapper">
- <resultMap id="BaseResultMap" type="com.zhgd.scs.domain.DwssHwpGrindAndCut">
- <id property="id" column="id" jdbcType="BIGINT"/>
- <result property="state" column="state" jdbcType="INTEGER"/>
- <result property="projectId" column="project_id" jdbcType="BIGINT"/>
- <result property="isOver" column="is_over" jdbcType="INTEGER"/>
- <result property="step1UserId" column="step1_user_id" jdbcType="BIGINT"/>
- <result property="step1Name" column="step1_name" jdbcType="VARCHAR"/>
- <result property="step1Time" column="step1_time" jdbcType="TIMESTAMP"/>
- <result property="step1WorkDate" column="step1_work_date" jdbcType="VARCHAR"/>
- <result property="step1Company" column="step1_company" jdbcType="VARCHAR"/>
- <result property="step1Location" column="step1_location" jdbcType="VARCHAR"/>
- <result property="step2Time" column="step2_time" jdbcType="TIMESTAMP"/>
- <result property="step2Check1" column="step2_check1" jdbcType="INTEGER"/>
- <result property="step2Check2" column="step2_check2" jdbcType="INTEGER"/>
- <result property="step2Check3" column="step2_check3" jdbcType="INTEGER"/>
- <result property="step2Check4" column="step2_check4" jdbcType="INTEGER"/>
- <result property="step2Check5" column="step2_check5" jdbcType="INTEGER"/>
- <result property="step2Check6" column="step2_check6" jdbcType="INTEGER"/>
- <result property="step2Check7" column="step2_check7" jdbcType="INTEGER"/>
- <result property="step2Check8" column="step2_check8" jdbcType="INTEGER"/>
- <result property="step2Check9" column="step2_check9" jdbcType="INTEGER"/>
- <result property="step2UserId" column="step2_user_id" jdbcType="BIGINT"/>
- <result property="step3Time" column="step3_time" jdbcType="TIMESTAMP"/>
- <result property="step3Name" column="step3_name" jdbcType="VARCHAR"/>
- <result property="step3Sign" column="step3_sign" jdbcType="VARCHAR"/>
- <result property="step3UserId" column="step3_user_id" jdbcType="BIGINT"/>
- <result property="step4Time" column="step4_time" jdbcType="TIMESTAMP"/>
- <result property="step4Check1" column="step4_check1" jdbcType="INTEGER"/>
- <result property="step4Check2" column="step4_check2" jdbcType="INTEGER"/>
- <result property="step4UserId" column="step4_user_id" jdbcType="BIGINT"/>
- <result property="step5Name" column="step5_name" jdbcType="VARCHAR"/>
- <result property="step5Sign" column="step5_sign" jdbcType="VARCHAR"/>
- <result property="step5Time" column="step5_time" jdbcType="TIMESTAMP"/>
- <result property="step5UserId" column="step5_user_id" jdbcType="BIGINT"/>
- </resultMap>
- <select id="unResolvedpage" resultType="com.zhgd.scs.domain.DwssHwpGrindAndCut">
- SELECT dc.*,
- du.id uid,
- du.hwp_id,
- du.user_id
- FROM `dwss_hwp_grind_and_cut` dc
- left join dwss_hwp_grind_and_cut_user_ref du on du.hwp_id = dc.id
- where dc.project_id = #{projectId}
- <if test="startDate!=null and endDate!=null">
- AND dc.step1_work_date BETWEEN #{startDate} AND #{endDate}
- </if>
- <if test="readId!=null">
- AND dc.id < #{readId}
- </if>
- and(
- (dc.step1_user_id=#{userId} and(( dc.step2_user_id is null and dc.state=1) or(dc.step4_user_id is null and
- dc.state=3)))
- or
- (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
- null and dc.state=5)))
- or
- (dc.is_over = 0 and (dc.step1_user_id=#{userId} or du.user_id = #{userId}))
- )
- GROUP BY dc.id
- order by dc.id desc
- </select>
- <select id="myResolvedpage" resultType="com.zhgd.scs.domain.DwssHwpGrindAndCut">
- SELECT dc.*,
- du.id uid,
- du.hwp_id,
- du.user_id
- FROM `dwss_hwp_grind_and_cut` dc
- left join dwss_hwp_grind_and_cut_user_ref du on du.hwp_id = dc.id
- where dc.project_id = #{projectId}
- <if test="startDate!=null and endDate!=null">
- AND dc.step1_work_date BETWEEN #{startDate} AND #{endDate}
- </if>
- <if test="readId!=null">
- AND dc.id < #{readId}
- </if>
- and(
- (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})
- or
- (dc.is_over = 1 and (dc.step1_user_id=#{userId} or du.user_id = #{userId}))
- )
- GROUP BY dc.id
- order by dc.id desc
- </select>
- <select id="getMyWoklistPage" resultType="com.zhgd.scs.domain.DwssHwpGrindAndCut">
- SELECT dc.*,
- u.id uid,
- u.hwp_id,
- u.user_id
- FROM dwss_hwp_grind_and_cut dc
- LEFT JOIN dwss_hwp_grind_and_cut_user_ref u on u.hwp_id = dc.id
- Where dc.project_id = #{projectId} and (dc.step1_user_id = #{userId} or u.user_id=#{userId})
- <if test="isOver!=null">
- and dc.is_over=#{isOver}
- </if>
- <if test="startDate!=null and endDate!=null">
- AND dc.step1_work_date BETWEEN #{startDate} AND #{endDate}
- </if>
- <if test="readId!=null">
- AND dc.id < #{readId}
- </if>
- GROUP BY dc.id
- order by dc.id desc
- </select>
- </mapper>
|