TgjjDwzhxxMapper2.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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.TgjjDwzhxxMapper2">
  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.TgjjDwzhxx" id="TgjjDwzhxxResult">
  16. </resultMap>
  17. <parameterMap id="TgjjDwzhxx" type="com.sooka.model.bo.TgjjDwzhxx"></parameterMap>
  18. <sql id="selectTgjjDwzhxxVo">
  19. select ID, DWZH, DWJCBL, GRJCBL, DWJCRS, DWFCRS, DWZHYE, DWXHRQ, DWXHYY, DWZHZT, JZNY, ZXBH, LAST_UPDATE_TIME lastUpdateTime, CLLX from tgjj_dwzhxx
  20. </sql>
  21. <select id="selectTgjjDwzhxxList" parameterMap="TgjjDwzhxx" resultMap="TgjjDwzhxxResult">
  22. <include refid="selectTgjjDwzhxxVo"/>
  23. <where>
  24. <if test="DWZH != null and DWZH != ''"> and DWZH = #{DWZH}</if>
  25. <if test="DWJCBL != null "> and DWJCBL = #{DWJCBL}</if>
  26. <if test="GRJCBL != null "> and GRJCBL = #{GRJCBL}</if>
  27. <if test="DWJCRS != null "> and DWJCRS = #{DWJCRS}</if>
  28. <if test="DWFCRS != null "> and DWFCRS = #{DWFCRS}</if>
  29. <if test="DWZHYE != null "> and DWZHYE = #{DWZHYE}</if>
  30. <if test="DWXHRQ != null "> and DWXHRQ = #{DWXHRQ}</if>
  31. <if test="DWXHYY != null and DWXHYY != ''"> and DWXHYY = #{DWXHYY}</if>
  32. <if test="DWZHZT != null and DWZHZT != ''"> and DWZHZT = #{DWZHZT}</if>
  33. <if test="JZNY != null and JZNY != ''"> and JZNY = #{JZNY}</if>
  34. <if test="ZXBH != null and ZXBH != ''"> and ZXBH = #{ZXBH}</if>
  35. <if test="lastUpdateTime != null "> and LAST_UPDATE_TIME = #{lastUpdateTime}</if>
  36. <if test="CLLX != null "> and CLLX = #{CLLX}</if>
  37. <if test="search_begintime != null"> and LAST_UPDATE_TIME >= #{search_begintime}</if>
  38. <if test="search_endtime != null"> and LAST_UPDATE_TIME &lt; #{search_endtime}</if>
  39. </where>
  40. </select>
  41. <select id="selectTgjjDwzhxxById" parameterType="Long" resultMap="TgjjDwzhxxResult">
  42. <include refid="selectTgjjDwzhxxVo"/>
  43. where ID = #{ID}
  44. </select>
  45. <insert id="insertTgjjDwzhxx" parameterMap="TgjjDwzhxx" useGeneratedKeys="true" keyProperty="ID">
  46. insert into tgjj_dwzhxx
  47. <trim prefix="(" suffix=")" suffixOverrides=",">
  48. <include refid="global_name"></include>
  49. <if test="DWZH != null">DWZH,</if>
  50. <if test="DWJCBL != null">DWJCBL,</if>
  51. <if test="GRJCBL != null">GRJCBL,</if>
  52. <if test="DWJCRS != null">DWJCRS,</if>
  53. <if test="DWFCRS != null">DWFCRS,</if>
  54. <if test="DWZHYE != null">DWZHYE,</if>
  55. <if test="DWXHRQ != null">DWXHRQ,</if>
  56. <if test="DWXHYY != null">DWXHYY,</if>
  57. <if test="DWZHZT != null">DWZHZT,</if>
  58. <if test="JZNY != null">JZNY,</if>
  59. <if test="ZXBH != null">ZXBH,</if>
  60. <if test="lastUpdateTime != null">LAST_UPDATE_TIME,</if>
  61. <if test="CLLX != null">CLLX,</if>
  62. </trim>
  63. <trim prefix="values (" suffix=")" suffixOverrides=",">
  64. <include refid="global_value"></include>
  65. <if test="DWZH != null">#{DWZH},</if>
  66. <if test="DWJCBL != null">#{DWJCBL},</if>
  67. <if test="GRJCBL != null">#{GRJCBL},</if>
  68. <if test="DWJCRS != null">#{DWJCRS},</if>
  69. <if test="DWFCRS != null">#{DWFCRS},</if>
  70. <if test="DWZHYE != null">#{DWZHYE},</if>
  71. <if test="DWXHRQ != null">#{DWXHRQ},</if>
  72. <if test="DWXHYY != null">#{DWXHYY},</if>
  73. <if test="DWZHZT != null">#{DWZHZT},</if>
  74. <if test="JZNY != null">#{JZNY},</if>
  75. <if test="ZXBH != null">#{ZXBH},</if>
  76. <if test="lastUpdateTime != null">#{lastUpdateTime},</if>
  77. <if test="CLLX != null">#{CLLX},</if>
  78. </trim>
  79. </insert>
  80. <update id="updateTgjjDwzhxx" parameterMap="TgjjDwzhxx">
  81. update tgjj_dwzhxx
  82. <trim prefix="SET" suffixOverrides=",">
  83. <include refid="update_sql"></include>
  84. <if test="DWZH != null">DWZH = #{DWZH},</if>
  85. <if test="DWJCBL != null">DWJCBL = #{DWJCBL},</if>
  86. <if test="GRJCBL != null">GRJCBL = #{GRJCBL},</if>
  87. <if test="DWJCRS != null">DWJCRS = #{DWJCRS},</if>
  88. <if test="DWFCRS != null">DWFCRS = #{DWFCRS},</if>
  89. <if test="DWZHYE != null">DWZHYE = #{DWZHYE},</if>
  90. <if test="DWXHRQ != null">DWXHRQ = #{DWXHRQ},</if>
  91. <if test="DWXHYY != null">DWXHYY = #{DWXHYY},</if>
  92. <if test="DWZHZT != null">DWZHZT = #{DWZHZT},</if>
  93. <if test="JZNY != null">JZNY = #{JZNY},</if>
  94. <if test="ZXBH != null">ZXBH = #{ZXBH},</if>
  95. <if test="lastUpdateTime != null">LAST_UPDATE_TIME = #{lastUpdateTime},</if>
  96. <if test="CLLX != null">CLLX = #{CLLX},</if>
  97. </trim>
  98. where ID = #{ID}
  99. </update>
  100. <select id="selectTgjjDwzhxxList_select_dwzhxx" parameterMap="TgjjDwzhxx" resultMap="TgjjDwzhxxResult">
  101. <include refid="selectTgjjDwzhxxVo"/>
  102. <where>
  103. <if test="DWZH != null and DWZH != ''">
  104. and DWZH = #{DWZH}
  105. </if>
  106. </where>
  107. </select>
  108. </mapper>