Deposit.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.employment.modules.base.dao.DepositDAO">
  6. <resultMap id="DepositMap" type="com.jpsoft.employment.modules.base.entity.Deposit">
  7. <id property="id" column="id_" />
  8. <result property="amount" column="amount_" />
  9. <result property="technicianId" column="technician_id" />
  10. <result property="payType" column="pay_type" />
  11. <result property="payStatus" column="pay_status_" />
  12. <result property="payTime" column="pay_time" />
  13. <result property="createTime" column="create_time" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="delFlag" column="del_flag" />
  16. <result property="createBy" column="create_by" />
  17. <result property="updateBy" column="update_by" />
  18. </resultMap>
  19. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.Deposit">
  20. <!--
  21. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  22. select sys_guid() from dual
  23. </selectKey>
  24. -->
  25. <![CDATA[
  26. insert into base_deposit
  27. (id_,amount_,technician_id,pay_type,pay_status_,pay_time,create_time,update_time,del_flag,create_by,update_by)
  28. values
  29. (
  30. #{id,jdbcType=VARCHAR}
  31. ,#{amount,jdbcType= NUMERIC }
  32. ,#{technicianId,jdbcType=VARCHAR}
  33. ,#{payType,jdbcType=VARCHAR}
  34. ,#{payStatus,jdbcType=VARCHAR}
  35. ,#{payTime,jdbcType= TIMESTAMP }
  36. ,#{createTime,jdbcType= TIMESTAMP }
  37. ,#{updateTime,jdbcType= TIMESTAMP }
  38. ,#{delFlag,jdbcType= NUMERIC }
  39. ,#{createBy,jdbcType=VARCHAR}
  40. ,#{updateBy,jdbcType=VARCHAR}
  41. )
  42. ]]>
  43. </insert>
  44. <delete id="delete" parameterType="string">
  45. delete from base_deposit where id_=#{id,jdbcType=VARCHAR}
  46. </delete>
  47. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.Deposit">
  48. update base_deposit
  49. <set>
  50. <if test="amount!=null">
  51. amount_=#{amount,jdbcType= NUMERIC },
  52. </if>
  53. <if test="technicianId!=null">
  54. technician_id=#{technicianId,jdbcType=VARCHAR},
  55. </if>
  56. <if test="payType!=null">
  57. pay_type=#{payType,jdbcType=VARCHAR},
  58. </if>
  59. <if test="payStatus!=null">
  60. pay_status_=#{payStatus,jdbcType=VARCHAR},
  61. </if>
  62. <if test="payTime!=null">
  63. pay_time=#{payTime,jdbcType= TIMESTAMP },
  64. </if>
  65. <if test="createTime!=null">
  66. create_time=#{createTime,jdbcType= TIMESTAMP },
  67. </if>
  68. <if test="updateTime!=null">
  69. update_time=#{updateTime,jdbcType= TIMESTAMP },
  70. </if>
  71. <if test="delFlag!=null">
  72. del_flag=#{delFlag,jdbcType= NUMERIC },
  73. </if>
  74. <if test="createBy!=null">
  75. create_by=#{createBy,jdbcType=VARCHAR},
  76. </if>
  77. <if test="updateBy!=null">
  78. update_by=#{updateBy,jdbcType=VARCHAR},
  79. </if>
  80. </set>
  81. where id_=#{id}
  82. </update>
  83. <select id="get" parameterType="string" resultMap="DepositMap">
  84. select
  85. id_,amount_,technician_id,pay_type,pay_status_,pay_time,create_time,update_time,del_flag,create_by,update_by from base_deposit where id_=#{0}
  86. </select>
  87. <select id="exist" parameterType="string" resultType="int">
  88. select count(*) from base_deposit where id_=#{0}
  89. </select>
  90. <select id="list" resultMap="DepositMap">
  91. select * from base_deposit
  92. </select>
  93. <select id="search" parameterType="hashmap" resultMap="DepositMap">
  94. <![CDATA[
  95. select * from base_deposit
  96. ]]>
  97. <where>
  98. <if test="searchParams.id != null">
  99. and ID_ like #{searchParams.id}
  100. </if>
  101. </where>
  102. <foreach item="sort" collection="sortList" open="order by" separator=",">
  103. ${sort.name} ${sort.order}
  104. </foreach>
  105. </select>
  106. </mapper>