TradeRuleMapper.xml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.unis.transaction.server.dao.TradeRuleDao">
  4. <sql id="traderuleColumns">
  5. zb.xzbm as xzbm,
  6. zb.xzbt as xzbt,
  7. zb.xzzw as xzzw,
  8. zb.bzsj as bzsj,
  9. zb.fjid as fjid,
  10. zb.bzr as bzr,
  11. zb.fbzt as fbzt,
  12. zb.fbztmc as fbztmc,
  13. zb.remark as remark,
  14. zb.lsxzbm,
  15. zb.lsxzmc
  16. </sql>
  17. <sql id="traderuleJoins">
  18. </sql>
  19. <select id="selectList" resultType="com.unis.transaction.server.entity.tradeplan.TradeRuleDO" parameterType="com.unis.transaction.common.vo.tradeplan.TradeRuleVO">
  20. SELECT
  21. <include refid="traderuleColumns" />
  22. FROM ty_jyxz zb <include refid="traderuleJoins" />
  23. <where>
  24. </where>
  25. </select>
  26. <select id="selectPageList" resultType="com.unis.transaction.common.vo.tradeplan.TradeRuleVO" parameterType="com.unis.transaction.common.vo.tradeplan.TradeRuleVO">
  27. select
  28. <include refid="traderuleColumns" />
  29. from ty_jyxz zb <include refid="traderuleJoins" />
  30. <where>
  31. and zb.status = 1
  32. <if test="xzbt != null and xzbt != ''">
  33. and zb.xzbt like '%' || #{xzbt} || '%'
  34. </if>
  35. <if test="fbzt != null">
  36. and zb.fbzt = #{fbzt}
  37. </if>
  38. <if test="lsxzbm != null and lsxzbm != ''">
  39. and zb.lsxzbm = #{lsxzbm}
  40. </if>
  41. <if test="startDate != null">
  42. and zb.bzsj &gt;= #{startDate}
  43. </if>
  44. <if test="endDate != null">
  45. and zb.bzsj &lt;= #{endDate}
  46. </if>
  47. </where>
  48. order by zb.xzbm desc
  49. </select>
  50. <select id="selectDetail" resultType="com.unis.transaction.common.vo.tradeplan.TradeRuleVO" parameterType="com.unis.transaction.common.vo.tradeplan.TradeRuleVO">
  51. SELECT
  52. <include refid="traderuleColumns" />
  53. FROM ty_jyxz zb <include refid="traderuleJoins" />
  54. <where>
  55. and zb.xzbm = #{xzbm}
  56. </where>
  57. </select>
  58. <insert id="insertTradeRule">
  59. INSERT INTO ty_jyxz(
  60. xzbm,xzbt,xzzw,bzsj,fjid,bzr,fbzt,fbztmc,remark,lsxzbm,lsxzmc)
  61. VALUES (
  62. #{xzbm},#{xzbt},#{xzzw},#{bzsj},#{fjid},#{bzr},#{fbzt},#{fbztmc},#{remark},#{lsxzbm},#{lsxzmc})
  63. </insert>
  64. <update id="updateTradeRule">
  65. UPDATE ty_jyxz SET
  66. xzbm = #{xzbm},xzbt = #{xzbt},xzzw = #{xzzw},bzsj = #{bzsj},fjid =
  67. #{fjid},bzr = #{bzr},fbzt = #{fbzt},fbztmc = #{fbztmc},remark =
  68. #{remark},lsxzbm = #{lsxzbm},lsxzmc = #{lsxzmc}
  69. WHERE id = #{id}
  70. </update>
  71. <update id="deleteTradeRule">
  72. DELETE FROM ty_jyxz
  73. WHERE id = #{id}
  74. </update>
  75. </mapper>