InsuranceDefinition.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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.picc.modules.base.dao.InsuranceDefinitionDAO">
  6. <resultMap id="InsuranceDefinitionMap" type="com.jpsoft.picc.modules.base.entity.InsuranceDefinition">
  7. <id property="id" column="id_"/>
  8. <result property="name" column="name_"/>
  9. <result property="insuranceDescription" column="insurance_description"/>
  10. <result property="clause" column="clause_"/>
  11. <result property="status" column="status_"/>
  12. <result property="delFlag" column="del_flag"/>
  13. <result property="createBy" column="create_by"/>
  14. <result property="createTime" column="create_time"/>
  15. <result property="updateBy" column="update_by"/>
  16. <result property="updateTime" column="update_time"/>
  17. <result property="cutOffTime" column="cut_off_time"/>
  18. <result property="advanceSubmitDays" column="advance_submit_days"/>
  19. <result property="notice" column="notice_"/>
  20. <result property="letter" column="letter_"/>
  21. <result property="specialStatement" column="special_statement"/>
  22. <result property="exemptionInstructions" column="exemption_instructions"/>
  23. <result property="responsibility" column="responsibility_"/>
  24. <result property="responsibilityAttach" column="responsibility_attach"/>
  25. <result property="haveAttach" column="have_attach"/>
  26. <result property="isShow" column="is_show"/>
  27. </resultMap>
  28. <insert id="insert" parameterType="com.jpsoft.picc.modules.base.entity.InsuranceDefinition">
  29. <!--
  30. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  31. select sys_guid() from dual
  32. </selectKey>
  33. -->
  34. <![CDATA[
  35. insert into base_insurance_definition
  36. (id_,name_,insurance_description,clause_,status_,del_flag,create_by,create_time,
  37. update_by,update_time,cut_off_time,notice_,advance_submit_days,
  38. letter_ ,special_statement ,exemption_instructions ,responsibility_ ,responsibility_attach ,have_attach,
  39. is_show
  40. )
  41. values
  42. (
  43. #{id,jdbcType=VARCHAR}
  44. ,#{name,jdbcType=VARCHAR}
  45. ,#{insuranceDescription,jdbcType=VARCHAR}
  46. ,#{clause,jdbcType=VARCHAR}
  47. ,#{status,jdbcType=VARCHAR}
  48. ,#{delFlag,jdbcType= NUMERIC }
  49. ,#{createBy,jdbcType=VARCHAR}
  50. ,#{createTime,jdbcType= TIMESTAMP }
  51. ,#{updateBy,jdbcType=VARCHAR}
  52. ,#{updateTime,jdbcType= TIMESTAMP }
  53. ,#{cutOffTime,jdbcType= VARCHAR }
  54. ,#{notice,jdbcType= VARCHAR }
  55. ,#{advanceSubmitDays, jdbcType=NUMERIC}
  56. ,#{letter,jdbcType= VARCHAR }
  57. ,#{specialStatement,jdbcType= VARCHAR }
  58. ,#{exemptionInstructions,jdbcType= VARCHAR }
  59. ,#{responsibility,jdbcType= VARCHAR }
  60. ,#{responsibilityAttach,jdbcType= VARCHAR }
  61. ,#{haveAttach,jdbcType= NUMERIC }
  62. ,#{isShow,jdbcType= NUMERIC }
  63. )
  64. ]]>
  65. </insert>
  66. <delete id="delete" parameterType="string">
  67. delete from base_insurance_definition where id_=#{id,jdbcType=VARCHAR}
  68. </delete>
  69. <update id="update" parameterType="com.jpsoft.picc.modules.base.entity.InsuranceDefinition">
  70. update base_insurance_definition
  71. <set>
  72. <if test="name!=null">
  73. name_=#{name,jdbcType=VARCHAR},
  74. </if>
  75. <if test="insuranceDescription!=null">
  76. insurance_description=#{insuranceDescription,jdbcType=VARCHAR},
  77. </if>
  78. <if test="clause!=null">
  79. clause_=#{clause,jdbcType=VARCHAR},
  80. </if>
  81. <if test="status!=null">
  82. status_=#{status,jdbcType=VARCHAR},
  83. </if>
  84. <if test="delFlag!=null">
  85. del_flag=#{delFlag,jdbcType= NUMERIC },
  86. </if>
  87. <if test="createBy!=null">
  88. create_by=#{createBy,jdbcType=VARCHAR},
  89. </if>
  90. <if test="createTime!=null">
  91. create_time=#{createTime,jdbcType= TIMESTAMP },
  92. </if>
  93. <if test="updateBy!=null">
  94. update_by=#{updateBy,jdbcType=VARCHAR},
  95. </if>
  96. <if test="updateTime!=null">
  97. update_time=#{updateTime,jdbcType= TIMESTAMP },
  98. </if>
  99. <if test="cutOffTime!=null">
  100. cut_off_time=#{cutOffTime,jdbcType= VARCHAR },
  101. </if>
  102. <if test="notice!=null">
  103. notice_=#{notice,jdbcType= VARCHAR },
  104. </if>
  105. <if test="advanceSubmitDays!=null">
  106. advance_submit_days=#{advanceSubmitDays,jdbcType= NUMERIC },
  107. </if>
  108. <if test="letter!=null">
  109. letter_ =#{letter,jdbcType= VARCHAR },
  110. </if>
  111. <if test="specialStatement!=null">
  112. special_statement =#{specialStatement,jdbcType= VARCHAR },
  113. </if>
  114. <if test="exemptionInstructions!=null">
  115. exemption_instructions =#{exemptionInstructions,jdbcType= VARCHAR },
  116. </if>
  117. <if test="responsibility!=null">
  118. responsibility_ =#{responsibility,jdbcType= VARCHAR },
  119. </if>
  120. <if test="responsibilityAttach!=null">
  121. responsibility_attach =#{responsibilityAttach,jdbcType= VARCHAR },
  122. </if>
  123. <if test="haveAttach!=null">
  124. have_attach =#{haveAttach,jdbcType= NUMERIC },
  125. </if>
  126. <if test="isShow!=null">
  127. is_show =#{isShow,jdbcType= NUMERIC },
  128. </if>
  129. </set>
  130. where id_=#{id}
  131. </update>
  132. <select id="get" parameterType="string" resultMap="InsuranceDefinitionMap">
  133. select * from base_insurance_definition where id_=#{0}
  134. </select>
  135. <select id="exist" parameterType="string" resultType="int">
  136. select count(*) from base_insurance_definition where id_=#{0}
  137. </select>
  138. <select id="list" resultMap="InsuranceDefinitionMap">
  139. select * from base_insurance_definition where del_flag=0 and is_show=1
  140. </select>
  141. <select id="search" parameterType="hashmap" resultMap="InsuranceDefinitionMap">
  142. <![CDATA[
  143. select * from base_insurance_definition
  144. ]]>
  145. <where>
  146. and del_flag = false
  147. <if test="searchParams.name != null">
  148. and name_ like #{searchParams.name}
  149. </if>
  150. </where>
  151. <foreach item="sort" collection="sortList" open="order by" separator=",">
  152. ${sort.name} ${sort.order}
  153. </foreach>
  154. </select>
  155. <select id="findByName" parameterType="string" resultMap="InsuranceDefinitionMap">
  156. select * from base_insurance_definition where name_=#{0} and del_flag = false order by create_time desc limit 0,1
  157. </select>
  158. </mapper>