ZsyzShyjMapper.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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.ZsyzShyjMapper">
  6. <resultMap type="ZsyzShyj" id="ZsyzShyjResult">
  7. <result property="id" column="id"/>
  8. <result property="xmId" column="xm_id"/>
  9. <result property="xmbh" column="xmbh"/>
  10. <result property="deptId" column="dept_id"/>
  11. <result property="shrxm" column="shrxm"/>
  12. <result property="xmjd" column="xmjd"/>
  13. <result property="xmmc" column="xmmc"/>
  14. <result property="shjg" column="shjg"/>
  15. <result property="shyj" column="shyj"/>
  16. <result property="shsj" column="shsj"/>
  17. <result property="createBy" column="create_by"/>
  18. <result property="createTime" column="create_time"/>
  19. <result property="updateBy" column="update_by"/>
  20. <result property="updateTime" column="update_time"/>
  21. <result property="remark" column="remark"/>
  22. <collection property="zsyzLdpsList" javaType="java.util.List" resultMap="ZsyzLdpsResult"/>
  23. </resultMap>
  24. <resultMap type="ZsyzLdps" id="ZsyzLdpsResult">
  25. <result property="ids" column="ids"/>
  26. <result property="xmId" column="xm_id"/>
  27. <result property="xmbh" column="xmbh"/>
  28. <result property="xmmc" column="xmmc"/>
  29. <result property="sourceId" column="source_id"/>
  30. <result property="psnr" column="psnr"/>
  31. <result property="zcpsnr" column="zcpsnr"/>
  32. <result property="remark" column="remark"/>
  33. <result property="deptId" column="dept_id"/>
  34. <result property="psr" column="psr"/>
  35. <result property="cjsj" column="cjsj"/>
  36. <result property="xgr" column="xgr"/>
  37. <result property="xgsj" column="xgsj"/>
  38. </resultMap>
  39. <sql id="selectZsyzShyjVo">
  40. select s.id, s.xm_id, s.xmbh, s.dept_id, s.shrxm, s.xmjd,s.xmmc, s.shjg, s.shyj, s.shsj, s.create_by, s.create_time, s.update_by, s.update_time, s.remark ,
  41. l.id as ids, l.xm_id, l.xmbh, l.xmmc, l.source_id, l.psnr, l.zcpsnr, l.remark, l.dept_id, l.psr, l.cjsj, l.xgr, l.xgsj
  42. from zsyz_shyj s
  43. left join zsyz_ldps l on s.id = l.source_id
  44. </sql>
  45. <select id="selectZsyzShyjList" parameterType="ZsyzShyj" resultMap="ZsyzShyjResult">
  46. <include refid="selectZsyzShyjVo"/>
  47. <where>
  48. <if test="xmId != null ">and s.xm_id = #{xmId}</if>
  49. <if test="xmbh != null and xmbh != ''">and s.xmbh = #{xmbh}</if>
  50. <if test="xmmc != null and xmmc != ''">and s.xmmc = #{xmmc}</if>
  51. <if test="shrxm != null and shrxm != ''">and s.shrxm = #{shrxm}</if>
  52. <if test="xmjd != null and xmjd != ''">and s.xmjd = #{xmjd}</if>
  53. <if test="shjg != null and shjg != ''">and s.shjg = #{shjg}</if>
  54. <if test="shyj != null and shyj != ''">and s.shyj = #{shyj}</if>
  55. <if test="shsj != null ">and s.shsj = #{shsj}</if>
  56. </where>
  57. order by s.shsj desc
  58. </select>
  59. <select id="selectZsyzShyjById" parameterType="Long" resultMap="ZsyzShyjResult">
  60. <include refid="selectZsyzShyjVo"/>
  61. where l.id = #{id}
  62. </select>
  63. <!-- <select id="selectZsyzShyjListByWt" resultMap="ZsyzShyjResult">
  64. SELECT
  65. ANY_VALUE ( s.id ) as id,
  66. ANY_VALUE ( s.xm_id ) as xm_id ,
  67. ANY_VALUE ( s.xmbh ) as xmbh,
  68. ANY_VALUE ( s.dept_id ) as dept_id,
  69. ANY_VALUE ( s.shrxm ) as shrxm,
  70. ANY_VALUE ( s.xmjd ) as xmjd,
  71. ANY_VALUE ( s.xmmc ) as xmmc,
  72. ANY_VALUE ( s.shjg ) as shjg,
  73. ANY_VALUE ( s.shyj ) as shyj,
  74. ANY_VALUE ( s.shsj ) as shsj
  75. FROM
  76. zsyz_shyj s
  77. <where>
  78. s.shjg = '3'
  79. <if test="xmmc != null and xmmc != ''">and s.xmmc like concat( #{xmmc}, '%') </if>
  80. <if test="params.beginTime != null and params.beginTime != ''">&lt;!&ndash; 开始时间检索 &ndash;&gt;
  81. AND date_format(s.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
  82. </if>
  83. <if test="params.endTime != null and params.endTime != ''">&lt;!&ndash; 结束时间检索 &ndash;&gt;
  84. AND date_format(s.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
  85. </if>
  86. </where>
  87. &lt;!&ndash; 数据范围过滤 &ndash;&gt;
  88. ${params.dataScope}
  89. GROUP BY
  90. s.xm_id
  91. </select>-->
  92. <select id="selectZsyzShyjListByWt" resultMap="ZsyzShyjResult">
  93. SELECT
  94. s.id,
  95. s.xm_id ,
  96. s.xmbh,
  97. s.dept_id,
  98. s.shrxm,
  99. s.xmjd,
  100. s.xmmc,
  101. s.shjg,
  102. s.shyj,
  103. s.shsj
  104. FROM
  105. zsyz_shyj s
  106. <where>
  107. s.shjg = '3'
  108. <if test="xmmc != null and xmmc != ''">and s.xmmc like concat( #{xmmc}, '%') </if>
  109. <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
  110. AND date_format(s.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
  111. </if>
  112. <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
  113. AND date_format(s.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
  114. </if>
  115. </where>
  116. <!-- 数据范围过滤 -->
  117. ${params.dataScope}
  118. GROUP BY
  119. s.xm_id
  120. </select>
  121. <insert id="insertZsyzShyj" parameterType="ZsyzShyj" useGeneratedKeys="true" keyProperty="id">
  122. insert into zsyz_shyj
  123. <trim prefix="(" suffix=")" suffixOverrides=",">
  124. <if test="xmId != null">xm_id,</if>
  125. <if test="xmbh != null">xmbh,</if>
  126. <if test="xmmc != null">xmmc,</if>
  127. <if test="deptId != null">dept_id,</if>
  128. <if test="shrxm != null and shrxm != ''">shrxm,</if>
  129. <if test="xmjd != null and xmjd != ''">xmjd,</if>
  130. <if test="shjg != null and shjg != ''">shjg,</if>
  131. <if test="shyj != null">shyj,</if>
  132. <if test="shsj != null">shsj,</if>
  133. <if test="createBy != null">create_by,</if>
  134. <if test="updateBy != null">update_by,</if>
  135. <if test="updateTime != null">update_time,</if>
  136. <if test="remark != null">remark,</if>
  137. create_time
  138. </trim>
  139. <trim prefix="values (" suffix=")" suffixOverrides=",">
  140. <if test="xmId != null">#{xmId},</if>
  141. <if test="xmbh != null">#{xmbh},</if>
  142. <if test="xmmc != null and xmmc != ''">#{xmmc},</if>
  143. <if test="deptId != null">#{deptId},</if>
  144. <if test="shrxm != null and shrxm != ''">#{shrxm},</if>
  145. <if test="xmjd != null and xmjd != ''">#{xmjd},</if>
  146. <if test="shjg != null and shjg != ''">#{shjg},</if>
  147. <if test="shyj != null">#{shyj},</if>
  148. <if test="shsj != null">#{shsj},</if>
  149. <if test="createBy != null">#{createBy},</if>
  150. <if test="updateBy != null">#{updateBy},</if>
  151. <if test="updateTime != null">#{updateTime},</if>
  152. <if test="remark != null">#{remark},</if>
  153. sysdate()
  154. </trim>
  155. </insert>
  156. <update id="updateZsyzShyj" parameterType="ZsyzShyj">
  157. update zsyz_shyj
  158. <trim prefix="SET" suffixOverrides=",">
  159. <if test="xmId != null">xm_id = #{xmId},</if>
  160. <if test="xmbh != null">xmbh = #{xmbh},</if>
  161. <if test="xmmc != null and xmmc != ''">xmmc = #{xmmc},</if>
  162. <if test="deptId != null">dept_id = #{deptId},</if>
  163. <if test="shrxm != null and shrxm != ''">shrxm = #{shrxm},</if>
  164. <if test="xmjd != null and xmjd != ''">xmjd = #{xmjd},</if>
  165. <if test="shjg != null and shjg != ''">shjg = #{shjg},</if>
  166. <if test="shyj != null">shyj = #{shyj},</if>
  167. <if test="shsj != null">shsj = #{shsj},</if>
  168. <if test="createBy != null">create_by = #{createBy},</if>
  169. <if test="createTime != null">create_time = #{createTime},</if>
  170. <if test="updateBy != null">update_by = #{updateBy},</if>
  171. <if test="updateTime != null">update_time = #{updateTime},</if>
  172. <if test="remark != null">remark = #{remark},</if>
  173. </trim>
  174. where id = #{id}
  175. </update>
  176. <delete id="deleteZsyzShyjById" parameterType="Long">
  177. delete from zsyz_shyj where id = #{id}
  178. </delete>
  179. <delete id="deleteZsyzShyjByIds" parameterType="String">
  180. delete from zsyz_shyj where id in
  181. <foreach item="id" collection="array" open="(" separator="," close=")">
  182. #{id}
  183. </foreach>
  184. </delete>
  185. </mapper>