StationPayMapper.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.yijia.station.mapper.StationPayMapper">
  6. <resultMap type="StationPay" id="StationPayResult">
  7. <result property="payId" column="pay_id" />
  8. <result property="payMode" column="pay_mode" />
  9. <result property="stationId" column="station_id" />
  10. <result property="stationName" column="station_name" />
  11. <result property="imagePhotosFlag" column="image_photos_flag" />
  12. <result property="cardEnabledFlag" column="card_enabled_flag" />
  13. <result property="activityPic" column="activity_pic" />
  14. <result property="preferentialWayShareFlag" column="preferential_way_share_flag" />
  15. <result property="otherPreferentialWay" column="other_preferential_way" />
  16. <result property="payPrintNum" column="pay_print_num" />
  17. <result property="payCallbackPage" column="pay_callback_page" />
  18. <result property="wsPrintFlag" column="ws_print_flag" />
  19. <result property="printSetting" column="print_setting" />
  20. <result property="discountSetting" column="discount_setting" />
  21. </resultMap>
  22. <sql id="selectStationPayVo">
  23. select pay_id, pay_mode, station_id, station_name, image_photos_flag, card_enabled_flag, activity_pic, preferential_way_share_flag, other_preferential_way, pay_print_num, pay_callback_page, ws_print_flag, print_setting, discount_setting from station_pay
  24. </sql>
  25. <select id="selectStationPayList" parameterType="StationPay" resultMap="StationPayResult">
  26. <include refid="selectStationPayVo"/>
  27. <where>
  28. <if test="payMode != null and payMode != ''"> and pay_mode = #{payMode}</if>
  29. <if test="stationId != null "> and station_id = #{stationId}</if>
  30. <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
  31. <if test="imagePhotosFlag != null and imagePhotosFlag != ''"> and image_photos_flag = #{imagePhotosFlag}</if>
  32. <if test="cardEnabledFlag != null and cardEnabledFlag != ''"> and card_enabled_flag = #{cardEnabledFlag}</if>
  33. <if test="activityPic != null and activityPic != ''"> and activity_pic = #{activityPic}</if>
  34. <if test="preferentialWayShareFlag != null and preferentialWayShareFlag != ''"> and preferential_way_share_flag = #{preferentialWayShareFlag}</if>
  35. <if test="otherPreferentialWay != null and otherPreferentialWay != ''"> and other_preferential_way = #{otherPreferentialWay}</if>
  36. <if test="payPrintNum != null "> and pay_print_num = #{payPrintNum}</if>
  37. <if test="payCallbackPage != null and payCallbackPage != ''"> and pay_callback_page = #{payCallbackPage}</if>
  38. <if test="wsPrintFlag != null and wsPrintFlag != ''"> and ws_print_flag = #{wsPrintFlag}</if>
  39. <if test="printSetting != null and printSetting != ''"> and print_setting = #{printSetting}</if>
  40. <if test="discountSetting != null and discountSetting != ''"> and discount_setting = #{discountSetting}</if>
  41. <if test="stationIdList != null ">
  42. and station_id in
  43. <foreach item="item" index="index" collection="stationIdList"
  44. open="(" separator="," close=")">
  45. #{item}
  46. </foreach>
  47. </if>
  48. </where>
  49. </select>
  50. <select id="selectStationPayById" parameterType="Long" resultMap="StationPayResult">
  51. <include refid="selectStationPayVo"/>
  52. where pay_id = #{payId}
  53. </select>
  54. <insert id="insertStationPay" parameterType="StationPay" useGeneratedKeys="true" keyProperty="payId">
  55. insert into station_pay
  56. <trim prefix="(" suffix=")" suffixOverrides=",">
  57. <if test="payMode != null">pay_mode,</if>
  58. <if test="stationId != null">station_id,</if>
  59. <if test="stationName != null">station_name,</if>
  60. <if test="imagePhotosFlag != null">image_photos_flag,</if>
  61. <if test="cardEnabledFlag != null">card_enabled_flag,</if>
  62. <if test="activityPic != null">activity_pic,</if>
  63. <if test="preferentialWayShareFlag != null">preferential_way_share_flag,</if>
  64. <if test="otherPreferentialWay != null">other_preferential_way,</if>
  65. <if test="payPrintNum != null">pay_print_num,</if>
  66. <if test="payCallbackPage != null">pay_callback_page,</if>
  67. <if test="wsPrintFlag != null">ws_print_flag,</if>
  68. <if test="printSetting != null">print_setting,</if>
  69. <if test="discountSetting != null">discount_setting,</if>
  70. </trim>
  71. <trim prefix="values (" suffix=")" suffixOverrides=",">
  72. <if test="payMode != null">#{payMode},</if>
  73. <if test="stationId != null">#{stationId},</if>
  74. <if test="stationName != null">#{stationName},</if>
  75. <if test="imagePhotosFlag != null">#{imagePhotosFlag},</if>
  76. <if test="cardEnabledFlag != null">#{cardEnabledFlag},</if>
  77. <if test="activityPic != null">#{activityPic},</if>
  78. <if test="preferentialWayShareFlag != null">#{preferentialWayShareFlag},</if>
  79. <if test="otherPreferentialWay != null">#{otherPreferentialWay},</if>
  80. <if test="payPrintNum != null">#{payPrintNum},</if>
  81. <if test="payCallbackPage != null">#{payCallbackPage},</if>
  82. <if test="wsPrintFlag != null">#{wsPrintFlag},</if>
  83. <if test="printSetting != null">#{printSetting},</if>
  84. <if test="discountSetting != null">#{discountSetting},</if>
  85. </trim>
  86. </insert>
  87. <update id="updateStationPay" parameterType="StationPay">
  88. update station_pay
  89. <trim prefix="SET" suffixOverrides=",">
  90. <if test="payMode != null">pay_mode = #{payMode},</if>
  91. <if test="stationId != null">station_id = #{stationId},</if>
  92. <if test="stationName != null">station_name = #{stationName},</if>
  93. <if test="imagePhotosFlag != null">image_photos_flag = #{imagePhotosFlag},</if>
  94. <if test="cardEnabledFlag != null">card_enabled_flag = #{cardEnabledFlag},</if>
  95. <if test="activityPic != null">activity_pic = #{activityPic},</if>
  96. <if test="preferentialWayShareFlag != null">preferential_way_share_flag = #{preferentialWayShareFlag},</if>
  97. <if test="otherPreferentialWay != null">other_preferential_way = #{otherPreferentialWay},</if>
  98. <if test="payPrintNum != null">pay_print_num = #{payPrintNum},</if>
  99. <if test="payCallbackPage != null">pay_callback_page = #{payCallbackPage},</if>
  100. <if test="wsPrintFlag != null">ws_print_flag = #{wsPrintFlag},</if>
  101. <if test="printSetting != null">print_setting = #{printSetting},</if>
  102. <if test="discountSetting != null">discount_setting = #{discountSetting},</if>
  103. </trim>
  104. where pay_id = #{payId}
  105. </update>
  106. <delete id="deleteStationPayById" parameterType="Long">
  107. delete from station_pay where pay_id = #{payId}
  108. </delete>
  109. <delete id="deleteStationPayByIds" parameterType="String">
  110. delete from station_pay where pay_id in
  111. <foreach item="payId" collection="array" open="(" separator="," close=")">
  112. #{payId}
  113. </foreach>
  114. </delete>
  115. </mapper>