ZsyzLcjlMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.ruoyi.system.mapper.projectV2.ZsyzLcjlMapper">
  6. <resultMap type="ZsyzLcjl" id="ZsyzLcjlResult">
  7. <result property="id" column="id" />
  8. <result property="xmId" column="xm_id" />
  9. <result property="xmbh" column="xmbh" />
  10. <result property="xmmc" column="xmmc" />
  11. <result property="deptId" column="dept_id" />
  12. <result property="deptName" column="dept_name" />
  13. <result property="clTime" column="cl_time" />
  14. <result property="progress" column="progress" />
  15. <result property="xmStatus" column="xm_status" />
  16. <result property="createBy" column="create_by" />
  17. <result property="createTime" column="create_time" />
  18. <result property="updateBy" column="update_by" />
  19. <result property="updateTime" column="update_time" />
  20. <result property="remark" column="remark" />
  21. </resultMap>
  22. <sql id="selectZsyzLcjlVo">
  23. select id, xm_id, xmbh, xmmc, dept_id, dept_name, cl_time, progress,xm_status, create_by, create_time, update_by, update_time, remark from zsyz_lcjl
  24. </sql>
  25. <select id="selectZsyzLcjlList" parameterType="ZsyzLcjl" resultMap="ZsyzLcjlResult">
  26. <include refid="selectZsyzLcjlVo"/>
  27. <where>
  28. <if test="xmId != null "> and xm_id = #{xmId}</if>
  29. <if test="xmbh != null and xmbh != ''"> and xmbh = #{xmbh}</if>
  30. <if test="xmmc != null and xmmc != ''"> and xmmc = #{xmmc}</if>
  31. <if test="deptId != null "> and dept_id = #{deptId}</if>
  32. <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
  33. <if test="clTime != null "> and cl_time = #{clTime}</if>
  34. <if test="progress != null and progress != ''"> and progress = #{progress}</if>
  35. <if test="xmStatus != null and xmStatus != ''"> and xm_status = #{xmStatus}</if>
  36. </where>
  37. </select>
  38. <select id="selectZsyzLcjlById" parameterType="Long" resultMap="ZsyzLcjlResult">
  39. <include refid="selectZsyzLcjlVo"/>
  40. where id = #{id}
  41. </select>
  42. <select id="selectZsyzLcjlListQc" parameterType="ZsyzLcjl" resultMap="ZsyzLcjlResult">
  43. select ANY_VALUE(a.id) as id, ANY_VALUE(a.xm_id) as xm_id, ANY_VALUE(a.xmbh) as xmbh, ANY_VALUE(a.xmmc)as xmmc,
  44. ANY_VALUE(a.dept_id) as dept_id, ANY_VALUE(a.dept_name) as dept_name, ANY_VALUE(MAX(a.cl_time)) as cl_time, ANY_VALUE(a.progress) as progress
  45. from (select id, xm_id, xmbh, xmmc, dept_id, dept_name, cl_time, progress
  46. from zsyz_lcjl order by xm_id, cl_time desc) a group by xm_id
  47. </select>
  48. <!--<select id="selectZsyzLcjlListQc" resultType="com.ruoyi.system.domain.projectV2.ZsyzLcjl">
  49. select id, xm_id, xmbh, xmmc,
  50. dept_id, dept_name, MAX(cl_time) as cl_time, progress
  51. from (select id, xm_id, xmbh, xmmc, dept_id, dept_name, cl_time) as cl_time, progress
  52. from zsyz_lcjl order by xm_id, cl_time desc) a group by xm_id
  53. </select>-->
  54. <insert id="insertZsyzLcjl" parameterType="ZsyzLcjl" useGeneratedKeys="true" keyProperty="id">
  55. insert into zsyz_lcjl
  56. <trim prefix="(" suffix=")" suffixOverrides=",">
  57. <if test="xmId != null">xm_id,</if>
  58. <if test="xmbh != null">xmbh,</if>
  59. <if test="xmmc != null and xmmc != ''">xmmc,</if>
  60. <if test="deptId != null">dept_id,</if>
  61. <if test="deptName != null and deptName != ''">dept_name,</if>
  62. <if test="progress != null">progress,</if>
  63. <if test="xmStatus != null">xm_status,</if>
  64. <if test="createBy != null">create_by,</if>
  65. <if test="updateBy != null">update_by,</if>
  66. <if test="updateTime != null">update_time,</if>
  67. <if test="remark != null">remark,</if>
  68. cl_time,
  69. create_time
  70. </trim>
  71. <trim prefix="values (" suffix=")" suffixOverrides=",">
  72. <if test="xmId != null">#{xmId},</if>
  73. <if test="xmbh != null">#{xmbh},</if>
  74. <if test="xmmc != null and xmmc != ''">#{xmmc},</if>
  75. <if test="deptId != null">#{deptId},</if>
  76. <if test="deptName != null and deptName != ''">#{deptName},</if>
  77. <if test="progress != null">#{progress},</if>
  78. <if test="xmStatus != null">#{xmStatus},</if>
  79. <if test="createBy != null">#{createBy},</if>
  80. <if test="updateBy != null">#{updateBy},</if>
  81. <if test="updateTime != null">#{updateTime},</if>
  82. <if test="remark != null">#{remark},</if>
  83. sysdate(),
  84. sysdate()
  85. </trim>
  86. </insert>
  87. <update id="updateZsyzLcjl" parameterType="ZsyzLcjl">
  88. update zsyz_lcjl
  89. <trim prefix="SET" suffixOverrides=",">
  90. <if test="xmId != null">xm_id = #{xmId},</if>
  91. <if test="xmbh != null">xmbh = #{xmbh},</if>
  92. <if test="xmmc != null and xmmc != ''">xmmc = #{xmmc},</if>
  93. <if test="deptId != null">dept_id = #{deptId},</if>
  94. <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
  95. <if test="clTime != null">cl_time = #{clTime},</if>
  96. <if test="progress != null">progress = #{progress},</if>
  97. <if test="xmStatus != null">xm_status = #{xmStatus},</if>
  98. <if test="createBy != null">create_by = #{createBy},</if>
  99. <if test="createTime != null">create_time = #{createTime},</if>
  100. <if test="updateBy != null">update_by = #{updateBy},</if>
  101. <if test="updateTime != null">update_time = #{updateTime},</if>
  102. <if test="remark != null">remark = #{remark},</if>
  103. </trim>
  104. where id = #{id}
  105. </update>
  106. <delete id="deleteZsyzLcjlById" parameterType="Long">
  107. delete from zsyz_lcjl where id = #{id}
  108. </delete>
  109. <delete id="deleteZsyzLcjlByIds" parameterType="String">
  110. delete from zsyz_lcjl where id in
  111. <foreach item="id" collection="array" open="(" separator="," close=")">
  112. #{id}
  113. </foreach>
  114. </delete>
  115. </mapper>