StationPayMapper.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. </resultMap>
  20. <sql id="selectStationPayVo">
  21. 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 from station_pay
  22. </sql>
  23. <select id="selectStationPayList" parameterType="StationPay" resultMap="StationPayResult">
  24. <include refid="selectStationPayVo"/>
  25. <where>
  26. <if test="payMode != null and payMode != ''"> and pay_mode = #{payMode}</if>
  27. <if test="stationId != null "> and station_id = #{stationId}</if>
  28. <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
  29. <if test="imagePhotosFlag != null and imagePhotosFlag != ''"> and image_photos_flag = #{imagePhotosFlag}</if>
  30. <if test="cardEnabledFlag != null and cardEnabledFlag != ''"> and card_enabled_flag = #{cardEnabledFlag}</if>
  31. <if test="activityPic != null and activityPic != ''"> and activity_pic = #{activityPic}</if>
  32. <if test="preferentialWayShareFlag != null and preferentialWayShareFlag != ''"> and preferential_way_share_flag = #{preferentialWayShareFlag}</if>
  33. <if test="otherPreferentialWay != null and otherPreferentialWay != ''"> and other_preferential_way = #{otherPreferentialWay}</if>
  34. <if test="payPrintNum != null "> and pay_print_num = #{payPrintNum}</if>
  35. <if test="payCallbackPage != null and payCallbackPage != ''"> and pay_callback_page = #{payCallbackPage}</if>
  36. <if test="wsPrintFlag != null and wsPrintFlag != ''"> and ws_print_flag = #{wsPrintFlag}</if>
  37. </where>
  38. </select>
  39. <select id="selectStationPayById" parameterType="Long" resultMap="StationPayResult">
  40. <include refid="selectStationPayVo"/>
  41. where pay_id = #{payId}
  42. </select>
  43. <insert id="insertStationPay" parameterType="StationPay" useGeneratedKeys="true" keyProperty="payId">
  44. insert into station_pay
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="payMode != null">pay_mode,</if>
  47. <if test="stationId != null">station_id,</if>
  48. <if test="stationName != null">station_name,</if>
  49. <if test="imagePhotosFlag != null">image_photos_flag,</if>
  50. <if test="cardEnabledFlag != null">card_enabled_flag,</if>
  51. <if test="activityPic != null">activity_pic,</if>
  52. <if test="preferentialWayShareFlag != null">preferential_way_share_flag,</if>
  53. <if test="otherPreferentialWay != null">other_preferential_way,</if>
  54. <if test="payPrintNum != null">pay_print_num,</if>
  55. <if test="payCallbackPage != null">pay_callback_page,</if>
  56. <if test="wsPrintFlag != null">ws_print_flag,</if>
  57. </trim>
  58. <trim prefix="values (" suffix=")" suffixOverrides=",">
  59. <if test="payMode != null">#{payMode},</if>
  60. <if test="stationId != null">#{stationId},</if>
  61. <if test="stationName != null">#{stationName},</if>
  62. <if test="imagePhotosFlag != null">#{imagePhotosFlag},</if>
  63. <if test="cardEnabledFlag != null">#{cardEnabledFlag},</if>
  64. <if test="activityPic != null">#{activityPic},</if>
  65. <if test="preferentialWayShareFlag != null">#{preferentialWayShareFlag},</if>
  66. <if test="otherPreferentialWay != null">#{otherPreferentialWay},</if>
  67. <if test="payPrintNum != null">#{payPrintNum},</if>
  68. <if test="payCallbackPage != null">#{payCallbackPage},</if>
  69. <if test="wsPrintFlag != null">#{wsPrintFlag},</if>
  70. </trim>
  71. </insert>
  72. <update id="updateStationPay" parameterType="StationPay">
  73. update station_pay
  74. <trim prefix="SET" suffixOverrides=",">
  75. <if test="payMode != null">pay_mode = #{payMode},</if>
  76. <if test="stationId != null">station_id = #{stationId},</if>
  77. <if test="stationName != null">station_name = #{stationName},</if>
  78. <if test="imagePhotosFlag != null">image_photos_flag = #{imagePhotosFlag},</if>
  79. <if test="cardEnabledFlag != null">card_enabled_flag = #{cardEnabledFlag},</if>
  80. <if test="activityPic != null">activity_pic = #{activityPic},</if>
  81. <if test="preferentialWayShareFlag != null">preferential_way_share_flag = #{preferentialWayShareFlag},</if>
  82. <if test="otherPreferentialWay != null">other_preferential_way = #{otherPreferentialWay},</if>
  83. <if test="payPrintNum != null">pay_print_num = #{payPrintNum},</if>
  84. <if test="payCallbackPage != null">pay_callback_page = #{payCallbackPage},</if>
  85. <if test="wsPrintFlag != null">ws_print_flag = #{wsPrintFlag},</if>
  86. </trim>
  87. where pay_id = #{payId}
  88. </update>
  89. <delete id="deleteStationPayById" parameterType="Long">
  90. delete from station_pay where pay_id = #{payId}
  91. </delete>
  92. <delete id="deleteStationPayByIds" parameterType="String">
  93. delete from station_pay where pay_id in
  94. <foreach item="payId" collection="array" open="(" separator="," close=")">
  95. #{payId}
  96. </foreach>
  97. </delete>
  98. </mapper>