FgwJzqkMapper.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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.fgw.FgwJzqkMapper">
  6. <resultMap type="FgwJzqk" id="FgwJzqkResult">
  7. <result property="id" column="id" />
  8. <result property="jdId" column="jd_id" />
  9. <result property="xmId" column="xm_id" />
  10. <result property="xmbh" column="xmbh" />
  11. <result property="xmmc" column="xmmc" />
  12. <result property="deptId" column="dept_id" />
  13. <result property="deptName" column="dept_name" />
  14. <result property="isNt" column="is_nt" />
  15. <result property="isJs" column="is_js" />
  16. <result property="isJd" column="is_jd" />
  17. <result property="isJg" column="is_jg" />
  18. <result property="nttz" column="nttz" />
  19. <result property="jzqk" column="jzqk" />
  20. <result property="sgll" column="sgll" />
  21. <result property="hbTime" column="hb_time" />
  22. <result property="createBy" column="create_by" />
  23. <result property="createTime" column="create_time" />
  24. <result property="updateBy" column="update_by" />
  25. <result property="updateTime" column="update_time" />
  26. <result property="remark" column="remark" />
  27. <result property="isSh" column="is_sh" />
  28. </resultMap>
  29. <sql id="selectFgwJzqkVo">
  30. select id,jd_id, xm_id, xmbh,is_nt,is_js,is_jd,is_jg,nttz,is_sh, xmmc, dept_id, dept_name, jzqk, sgll, hb_time, create_by, create_time, update_by, update_time, remark from fgw_jzqk
  31. </sql>
  32. <select id="selectFgwJzqkList" parameterType="FgwJzqk" resultMap="FgwJzqkResult">
  33. <include refid="selectFgwJzqkVo"/>
  34. <where>
  35. <if test="jdId != null "> and jd_id = #{jdId}</if>
  36. <if test="xmId != null "> and xm_id = #{xmId}</if>
  37. <if test="xmbh != null and xmbh != ''"> and xmbh = #{xmbh}</if>
  38. <if test="xmmc != null and xmmc != ''"> and xmmc = #{xmmc}</if>
  39. <if test="isNt != null and isNt != ''"> and is_nt = #{isNt}</if>
  40. <if test="isJs != null and isJs != ''"> and is_js = #{isJs}</if>
  41. <if test="isSh != null and isSh != ''"> and is_sh = #{isSh}</if>
  42. <if test="isJd != null and isJd != ''"> and is_jd = #{isJd}</if>
  43. <if test="isJg != null and isJg != ''"> and is_jg = #{isJg}</if>
  44. <if test="deptId != null "> and dept_id = #{deptId}</if>
  45. <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
  46. <if test="jzqk != null and jzqk != ''"> and jzqk = #{jzqk}</if>
  47. <if test="sgll != null and sgll != ''"> and sgll = #{sgll}</if>
  48. <if test="hbTime != null "> and hb_time = #{hbTime}</if>
  49. <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
  50. AND date_format(hb_time,'%Y%m') = date_format(#{params.beginTime},'%Y%m')
  51. </if>
  52. </where>
  53. </select>
  54. <select id="selectFgwJzqkById" parameterType="Long" resultMap="FgwJzqkResult">
  55. <include refid="selectFgwJzqkVo"/>
  56. where id = #{id}
  57. </select>
  58. <select id="selectFgwJzqkTj" parameterType="FgwJzqk" resultMap="FgwJzqkResult">
  59. <include refid="selectFgwJzqkVo"/>
  60. <where>
  61. <if test="jdId != null "> and jd_id = #{jdId}</if>
  62. <if test="xmId != null "> and xm_id = #{xmId}</if>
  63. <if test="xmbh != null and xmbh != ''"> and xmbh = #{xmbh}</if>
  64. <if test="xmmc != null and xmmc != ''"> and xmmc = #{xmmc}</if>
  65. <if test="isNt != null and isNt != ''"> and is_nt = #{isNt}</if>
  66. <if test="isJs != null and isJs != ''"> and is_js = #{isJs}</if>
  67. <if test="isSh != null and isSh != ''"> and is_sh = #{isSh}</if>
  68. <if test="isJd != null and isJd != ''"> and is_jd = #{isJd}</if>
  69. <if test="isJg != null and isJg != ''"> and is_jg = #{isJg}</if>
  70. <if test="deptId != null "> and dept_id = #{deptId}</if>
  71. <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
  72. <if test="jzqk != null and jzqk != ''"> and jzqk = #{jzqk}</if>
  73. <if test="sgll != null and sgll != ''"> and sgll = #{sgll}</if>
  74. <if test="hbTime != null "> and hb_time = #{hbTime}</if>
  75. <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
  76. AND date_format(hb_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
  77. </if>
  78. <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
  79. AND date_format(hb_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
  80. </if>
  81. </where>
  82. </select>
  83. <insert id="insertFgwJzqk" parameterType="FgwJzqk" useGeneratedKeys="true" keyProperty="id">
  84. insert into fgw_jzqk
  85. <trim prefix="(" suffix=")" suffixOverrides=",">
  86. <if test="jdId != null "> jd_id,</if>
  87. <if test="xmId != null">xm_id,</if>
  88. <if test="xmbh != null">xmbh,</if>
  89. <if test="xmmc != null and xmmc != ''">xmmc,</if>
  90. <if test="deptId != null">dept_id,</if>
  91. <if test="deptName != null and deptName != ''">dept_name,</if>
  92. <if test="isNt != null and isNt != ''">is_nt,</if>
  93. <if test="isJs != null and isJs != ''">is_js,</if>
  94. <if test="isJd != null and isJd != ''">is_jd,</if>
  95. <if test="isJg != null and isJg != ''">is_jg,</if>
  96. <if test="nttz != null and nttz != ''">nttz,</if>
  97. <if test="isSh != null and isSh != ''">is_sh,</if>
  98. <if test="jzqk != null">jzqk,</if>
  99. <if test="sgll != null">sgll,</if>
  100. <if test="hbTime != null">hb_time,</if>
  101. <if test="createBy != null">create_by,</if>
  102. <if test="createTime != null">create_time,</if>
  103. <if test="updateBy != null">update_by,</if>
  104. <if test="updateTime != null">update_time,</if>
  105. <if test="remark != null">remark,</if>
  106. </trim>
  107. <trim prefix="values (" suffix=")" suffixOverrides=",">
  108. <if test="jdId != null ">#{jdId},</if>
  109. <if test="xmId != null">#{xmId},</if>
  110. <if test="xmbh != null">#{xmbh},</if>
  111. <if test="xmmc != null and xmmc != ''">#{xmmc},</if>
  112. <if test="deptId != null">#{deptId},</if>
  113. <if test="deptName != null and deptName != ''">#{deptName},</if>
  114. <if test="isNt != null and isNt != ''">#{isNt},</if>
  115. <if test="isJs != null and isJs != ''">#{isJs},</if>
  116. <if test="isJd != null and isJd != ''">#{isJd},</if>
  117. <if test="isJg != null and isJg != ''">#{isJg},</if>
  118. <if test="nttz != null and nttz != ''">#{nttz},</if>
  119. <if test="isSh != null and isSh != ''">#{isSh},</if>
  120. <if test="jzqk != null">#{jzqk},</if>
  121. <if test="sgll != null">#{sgll},</if>
  122. <if test="hbTime != null">#{hbTime},</if>
  123. <if test="createBy != null">#{createBy},</if>
  124. <if test="createTime != null">#{createTime},</if>
  125. <if test="updateBy != null">#{updateBy},</if>
  126. <if test="updateTime != null">#{updateTime},</if>
  127. <if test="remark != null">#{remark},</if>
  128. </trim>
  129. </insert>
  130. <update id="updateFgwJzqk" parameterType="FgwJzqk">
  131. update fgw_jzqk
  132. <trim prefix="SET" suffixOverrides=",">
  133. <if test="jdId != null ">jd_id = #{jdId},</if>
  134. <if test="xmId != null">xm_id = #{xmId},</if>
  135. <if test="xmbh != null">xmbh = #{xmbh},</if>
  136. <if test="xmmc != null and xmmc != ''">xmmc = #{xmmc},</if>
  137. <if test="deptId != null">dept_id = #{deptId},</if>
  138. <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
  139. <if test="isNt != null and isNt != ''">is_nt = #{isNt},</if>
  140. <if test="isJs != null and isJs != ''">is_js = #{isJs},</if>
  141. <if test="isJd != null and isJd != ''">is_jd = #{isJd},</if>
  142. <if test="isJg != null and isJg != ''">is_jg = #{isJg},</if>
  143. <if test="nttz != null and nttz != ''">nttz = #{nttz},</if>
  144. <if test="isSh != null and isSh != ''">is_sh = #{isSh},</if>
  145. <if test="jzqk != null">jzqk = #{jzqk},</if>
  146. <if test="sgll != null">sgll = #{sgll},</if>
  147. <if test="hbTime != null">hb_time = #{hbTime},</if>
  148. <if test="createBy != null">create_by = #{createBy},</if>
  149. <if test="createTime != null">create_time = #{createTime},</if>
  150. <if test="updateBy != null">update_by = #{updateBy},</if>
  151. <if test="updateTime != null">update_time = #{updateTime},</if>
  152. <if test="remark != null">remark = #{remark},</if>
  153. </trim>
  154. where id = #{id}
  155. </update>
  156. <delete id="deleteFgwJzqkById" parameterType="Long">
  157. delete from fgw_jzqk where id = #{id}
  158. </delete>
  159. <delete id="deleteFgwJzqkByIds" parameterType="String">
  160. delete from fgw_jzqk where id in
  161. <foreach item="id" collection="array" open="(" separator="," close=")">
  162. #{id}
  163. </foreach>
  164. </delete>
  165. </mapper>