ExpensesInfo.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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.ExpensesInfoDAO">
  6. <resultMap id="ExpensesInfoMap" type="com.jpsoft.employment.modules.base.entity.ExpensesInfo">
  7. <id property="id" column="id_" />
  8. <result property="serialNumber" column="serial_number" />
  9. <result property="name" column="name_" />
  10. <result property="amount" column="amount_" />
  11. <result property="executor" column="executor_" />
  12. <result property="responsiblePerson" column="responsible_person" />
  13. <result property="completionTime" column="completion_time" />
  14. <result property="feeStartDate" column="fee_start_date" />
  15. <result property="supervisor" column="supervisor" />
  16. <result property="aboutTopic" column="about_topic" />
  17. <result property="createTime" column="create_time" />
  18. <result property="updateTime" column="update_time" />
  19. <result property="createBy" column="create_by" />
  20. <result property="updateBy" column="update_by" />
  21. <result property="delFlag" column="del_flag" />
  22. <result property="year" column="year_" />
  23. <result property="index" column="index_" />
  24. <result property="templateId" column="template_id" />
  25. </resultMap>
  26. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.ExpensesInfo">
  27. <!--
  28. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  29. select sys_guid() from dual
  30. </selectKey>
  31. -->
  32. <![CDATA[
  33. insert into base_expenses_info
  34. (id_,serial_number,name_,amount_,executor_,responsible_person,completion_time,fee_start_date,supervisor,about_topic,create_time,update_time,create_by,update_by,del_flag,year_,index_,template_id)
  35. values
  36. (
  37. #{id,jdbcType=VARCHAR}
  38. ,#{serialNumber,jdbcType=VARCHAR}
  39. ,#{name,jdbcType=VARCHAR}
  40. ,#{amount,jdbcType= NUMERIC }
  41. ,#{executor,jdbcType=VARCHAR}
  42. ,#{responsiblePerson,jdbcType=VARCHAR}
  43. ,#{completionTime,jdbcType=VARCHAR}
  44. ,#{feeStartDate,jdbcType= TIMESTAMP }
  45. ,#{supervisor,jdbcType=VARCHAR}
  46. ,#{aboutTopic,jdbcType=VARCHAR}
  47. ,#{createTime,jdbcType= TIMESTAMP }
  48. ,#{updateTime,jdbcType= TIMESTAMP }
  49. ,#{createBy,jdbcType=VARCHAR}
  50. ,#{updateBy,jdbcType=VARCHAR}
  51. ,#{delFlag,jdbcType= NUMERIC }
  52. ,#{year,jdbcType= TIMESTAMP }
  53. ,#{index,jdbcType= NUMERIC }
  54. ,#{templateId,jdbcType=VARCHAR}
  55. )
  56. ]]>
  57. </insert>
  58. <delete id="delete" parameterType="string">
  59. delete from base_expenses_info where id_=#{id,jdbcType=VARCHAR}
  60. </delete>
  61. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.ExpensesInfo">
  62. update base_expenses_info
  63. <set>
  64. <if test="serialNumber!=null">
  65. serial_number=#{serialNumber,jdbcType=VARCHAR},
  66. </if>
  67. <if test="name!=null">
  68. name_=#{name,jdbcType=VARCHAR},
  69. </if>
  70. <if test="amount!=null">
  71. amount_=#{amount,jdbcType= NUMERIC },
  72. </if>
  73. <if test="executor!=null">
  74. executor_=#{executor,jdbcType=VARCHAR},
  75. </if>
  76. <if test="responsiblePerson!=null">
  77. responsible_person=#{responsiblePerson,jdbcType=VARCHAR},
  78. </if>
  79. <if test="completionTime!=null">
  80. completion_time=#{completionTime,jdbcType=VARCHAR},
  81. </if>
  82. <if test="feeStartDate!=null">
  83. fee_start_date=#{feeStartDate,jdbcType= TIMESTAMP },
  84. </if>
  85. <if test="supervisor!=null">
  86. supervisor=#{supervisor,jdbcType=VARCHAR},
  87. </if>
  88. <if test="aboutTopic!=null">
  89. about_topic=#{aboutTopic,jdbcType=VARCHAR},
  90. </if>
  91. <if test="createTime!=null">
  92. create_time=#{createTime,jdbcType= TIMESTAMP },
  93. </if>
  94. <if test="updateTime!=null">
  95. update_time=#{updateTime,jdbcType= TIMESTAMP },
  96. </if>
  97. <if test="createBy!=null">
  98. create_by=#{createBy,jdbcType=VARCHAR},
  99. </if>
  100. <if test="updateBy!=null">
  101. update_by=#{updateBy,jdbcType=VARCHAR},
  102. </if>
  103. <if test="delFlag!=null">
  104. del_flag=#{delFlag,jdbcType= NUMERIC },
  105. </if>
  106. <if test="year!=null">
  107. year_=#{year,jdbcType= TIMESTAMP },
  108. </if>
  109. <if test="index!=null">
  110. index_=#{index,jdbcType= NUMERIC },
  111. </if>
  112. <if test="templateId!=null">
  113. template_id=#{templateId,jdbcType=VARCHAR},
  114. </if>
  115. </set>
  116. where id_=#{id}
  117. </update>
  118. <select id="get" parameterType="string" resultMap="ExpensesInfoMap">
  119. select * from base_expenses_info where id_=#{0}
  120. </select>
  121. <select id="exist" parameterType="string" resultType="int">
  122. select count(*) from base_expenses_info where id_=#{0}
  123. </select>
  124. <select id="list" resultMap="ExpensesInfoMap">
  125. select * from base_expenses_info
  126. </select>
  127. <select id="search" parameterType="hashmap" resultMap="ExpensesInfoMap">
  128. <![CDATA[
  129. select * from base_expenses_info
  130. ]]>
  131. <where>
  132. del_flag = false
  133. <if test="searchParams.startDate != null">
  134. <![CDATA[
  135. and year_>=#{searchParams.startDate}
  136. ]]>
  137. </if>
  138. <if test="searchParams.endDate != null">
  139. <![CDATA[
  140. and year_<=#{searchParams.endDate}
  141. ]]>
  142. </if>
  143. <if test="searchParams.name != null">
  144. and name_ = #{searchParams.name}
  145. </if>
  146. </where>
  147. <foreach item="sort" collection="sortList" open="order by" separator=",">
  148. ${sort.name} ${sort.order}
  149. </foreach>
  150. </select>
  151. </mapper>