FgwJzqkMapper.xml 9.0 KB

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