TgjjGrxxMapper2.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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.sooka.mapper.TgjjGrxxMapper2">
  6. <sql id="global_name">
  7. ID,create_time,cd_time,cd_batch,cd_operation,cd_source,
  8. </sql>
  9. <sql id="global_value">
  10. #{ID},now(),#{cd_time},#{cd_batch},#{cd_operation},#{cd_source},
  11. </sql>
  12. <sql id="update_sql">
  13. create_time = now(),cd_batch = #{cd_batch},cd_operation = #{cd_operation},cd_source =#{cd_source},
  14. </sql>
  15. <resultMap type="com.sooka.model.bo.TgjjGrxx" id="TgjjGrxxResult">
  16. </resultMap>
  17. <parameterMap id="TgjjGrxx" type="com.sooka.model.bo.TgjjGrxx"></parameterMap>
  18. <sql id="selectTgjjGrxxVo">
  19. select ID, GRZH, XINGMING, XMQP, XINGBIE, GDDHHM, SJHM, ZJLX, ZJHM, CSNY, HYZK, ZHIYE, ZHICHEN, ZHIWU, XUELI, YZBM, JTZZ, JTYSR, ZXBH, LAST_UPDATE_TIME lastUpdateTime, CLLX from tgjj_grxx
  20. </sql>
  21. <select id="selectTgjjGrxxList" parameterMap="TgjjGrxx" resultMap="TgjjGrxxResult">
  22. <include refid="selectTgjjGrxxVo"/>
  23. <where>
  24. <if test="GRZH != null and GRZH != ''"> and GRZH = #{GRZH}</if>
  25. <if test="XINGMING != null and XINGMING != ''"> and XINGMING = #{XINGMING}</if>
  26. <if test="XMQP != null and XMQP != ''"> and XMQP = #{XMQP}</if>
  27. <if test="XINGBIE != null and XINGBIE != ''"> and XINGBIE = #{XINGBIE}</if>
  28. <if test="GDDHHM != null and GDDHHM != ''"> and GDDHHM = #{GDDHHM}</if>
  29. <if test="SJHM != null and SJHM != ''"> and SJHM = #{SJHM}</if>
  30. <if test="ZJLX != null and ZJLX != ''"> and ZJLX = #{ZJLX}</if>
  31. <if test="ZJHM != null and ZJHM != ''"> and ZJHM = #{ZJHM}</if>
  32. <if test="CSNY != null and CSNY != ''"> and CSNY = #{CSNY}</if>
  33. <if test="HYZK != null and HYZK != ''"> and HYZK = #{HYZK}</if>
  34. <if test="ZHIYE != null and ZHIYE != ''"> and ZHIYE = #{ZHIYE}</if>
  35. <if test="ZHICHEN != null and ZHICHEN != ''"> and ZHICHEN = #{ZHICHEN}</if>
  36. <if test="ZHIWU != null and ZHIWU != ''"> and ZHIWU = #{ZHIWU}</if>
  37. <if test="XUELI != null and XUELI != ''"> and XUELI = #{XUELI}</if>
  38. <if test="YZBM != null and YZBM != ''"> and YZBM = #{YZBM}</if>
  39. <if test="JTZZ != null and JTZZ != ''"> and JTZZ = #{JTZZ}</if>
  40. <if test="JTYSR != null "> and JTYSR = #{JTYSR}</if>
  41. <if test="ZXBH != null and ZXBH != ''"> and ZXBH = #{ZXBH}</if>
  42. <if test="lastUpdateTime != null "> and LAST_UPDATE_TIME = #{lastUpdateTime}</if>
  43. <if test="CLLX != null "> and CLLX = #{CLLX}</if>
  44. <if test="search_begintime != null"> and LAST_UPDATE_TIME >= #{search_begintime}</if>
  45. <if test="search_endtime != null"> and LAST_UPDATE_TIME &lt; #{search_endtime}</if>
  46. </where>
  47. </select>
  48. <select id="selectTgjjGrxxById" parameterType="Long" resultMap="TgjjGrxxResult">
  49. <include refid="selectTgjjGrxxVo"/>
  50. where ID = #{ID
  51. </select>
  52. <insert id="insertTgjjGrxx" parameterMap="TgjjGrxx" useGeneratedKeys="true" keyProperty="ID">
  53. insert into tgjj_grxx
  54. <trim prefix="(" suffix=")" suffixOverrides=",">
  55. <include refid="global_name"></include>
  56. <if test="GRZH != null and GRZH != ''">GRZH,</if>
  57. <if test="XINGMING != null">XINGMING,</if>
  58. <if test="XMQP != null">XMQP,</if>
  59. <if test="XINGBIE != null">XINGBIE,</if>
  60. <if test="GDDHHM != null">GDDHHM,</if>
  61. <if test="SJHM != null">SJHM,</if>
  62. <if test="ZJLX != null">ZJLX,</if>
  63. <if test="ZJHM != null">ZJHM,</if>
  64. <if test="CSNY != null">CSNY,</if>
  65. <if test="HYZK != null">HYZK,</if>
  66. <if test="ZHIYE != null">ZHIYE,</if>
  67. <if test="ZHICHEN != null">ZHICHEN,</if>
  68. <if test="ZHIWU != null">ZHIWU,</if>
  69. <if test="XUELI != null">XUELI,</if>
  70. <if test="YZBM != null">YZBM,</if>
  71. <if test="JTZZ != null">JTZZ,</if>
  72. <if test="JTYSR != null">JTYSR,</if>
  73. <if test="ZXBH != null">ZXBH,</if>
  74. <if test="lastUpdateTime != null">LAST_UPDATE_TIME,</if>
  75. <if test="CLLX != null">CLLX,</if>
  76. </trim>
  77. <trim prefix="values (" suffix=")" suffixOverrides=",">
  78. <include refid="global_value"></include>
  79. <if test="GRZH != null and GRZH != ''">#{GRZH},</if>
  80. <if test="XINGMING != null">#{XINGMING},</if>
  81. <if test="XMQP != null">#{XMQP},</if>
  82. <if test="XINGBIE != null">#{XINGBIE},</if>
  83. <if test="GDDHHM != null">#{GDDHHM},</if>
  84. <if test="SJHM != null">#{SJHM},</if>
  85. <if test="ZJLX != null">#{ZJLX},</if>
  86. <if test="ZJHM != null">#{ZJHM},</if>
  87. <if test="CSNY != null">#{CSNY},</if>
  88. <if test="HYZK != null">#{HYZK},</if>
  89. <if test="ZHIYE != null">#{ZHIYE},</if>
  90. <if test="ZHICHEN != null">#{ZHICHEN},</if>
  91. <if test="ZHIWU != null">#{ZHIWU},</if>
  92. <if test="XUELI != null">#{XUELI},</if>
  93. <if test="YZBM != null">#{YZBM},</if>
  94. <if test="JTZZ != null">#{JTZZ},</if>
  95. <if test="JTYSR != null">#{JTYSR},</if>
  96. <if test="ZXBH != null">#{ZXBH},</if>
  97. <if test="lastUpdateTime != null">#{lastUpdateTime},</if>
  98. <if test="CLLX != null">#{CLLX},</if>
  99. </trim>
  100. </insert>
  101. <update id="updateTgjjGrxx" parameterMap="TgjjGrxx">
  102. update tgjj_grxx
  103. <trim prefix="SET" suffixOverrides=",">
  104. <include refid="update_sql"></include>
  105. <if test="GRZH != null and GRZH != ''">GRZH = #{GRZH},</if>
  106. <if test="XINGMING != null">XINGMING = #{XINGMING},</if>
  107. <if test="XMQP != null">XMQP = #{XMQP},</if>
  108. <if test="XINGBIE != null">XINGBIE = #{XINGBIE},</if>
  109. <if test="GDDHHM != null">GDDHHM = #{GDDHHM},</if>
  110. <if test="SJHM != null">SJHM = #{SJHM},</if>
  111. <if test="ZJLX != null">ZJLX = #{ZJLX},</if>
  112. <if test="ZJHM != null">ZJHM = #{ZJHM},</if>
  113. <if test="CSNY != null">CSNY = #{CSNY},</if>
  114. <if test="HYZK != null">HYZK = #{HYZK},</if>
  115. <if test="ZHIYE != null">ZHIYE = #{ZHIYE},</if>
  116. <if test="ZHICHEN != null">ZHICHEN = #{ZHICHEN},</if>
  117. <if test="ZHIWU != null">ZHIWU = #{ZHIWU},</if>
  118. <if test="XUELI != null">XUELI = #{XUELI},</if>
  119. <if test="YZBM != null">YZBM = #{YZBM},</if>
  120. <if test="JTZZ != null">JTZZ = #{JTZZ},</if>
  121. <if test="JTYSR != null">JTYSR = #{JTYSR},</if>
  122. <if test="ZXBH != null">ZXBH = #{ZXBH},</if>
  123. <if test="lastUpdateTime != null">LAST_UPDATE_TIME = #{lastUpdateTime},</if>
  124. <if test="CLLX != null">CLLX = #{CLLX},</if>
  125. </trim>
  126. where ID = #{ID}
  127. </update>
  128. <select id="selectTgjjGrxxList_select_grxx" parameterMap="TgjjGrxx" resultMap="TgjjGrxxResult">
  129. <include refid="selectTgjjGrxxVo"/>
  130. <where>
  131. <if test="GRZH != null and GRZH != ''">
  132. or GRZH = #{GRZH}
  133. </if>
  134. <if test="XINGMING != null and XINGMING != ''">
  135. or XINGMING = #{XINGMING}
  136. </if>
  137. <if test="ZJHM != null and ZJHM != null">
  138. or ZJHM = #{ZJHM}
  139. </if>
  140. </where>
  141. </select>
  142. </mapper>