InsuranceDefinition.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. </resultMap>
  18. <insert id="insert" parameterType="com.jpsoft.picc.modules.base.entity.InsuranceDefinition">
  19. <!--
  20. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  21. select sys_guid() from dual
  22. </selectKey>
  23. -->
  24. <![CDATA[
  25. insert into base_insurance_definition
  26. (id_,name_,insurance_description,clause_,status_,del_flag,create_by,create_time,update_by,update_time)
  27. values
  28. (
  29. #{id,jdbcType=VARCHAR}
  30. ,#{name,jdbcType=VARCHAR}
  31. ,#{insuranceDescription,jdbcType=VARCHAR}
  32. ,#{clause,jdbcType=VARCHAR}
  33. ,#{status,jdbcType=VARCHAR}
  34. ,#{delFlag,jdbcType= NUMERIC }
  35. ,#{createBy,jdbcType=VARCHAR}
  36. ,#{createTime,jdbcType= TIMESTAMP }
  37. ,#{updateBy,jdbcType=VARCHAR}
  38. ,#{updateTime,jdbcType= TIMESTAMP }
  39. )
  40. ]]>
  41. </insert>
  42. <delete id="delete" parameterType="string">
  43. delete from base_insurance_definition where id_=#{id,jdbcType=VARCHAR}
  44. </delete>
  45. <update id="update" parameterType="com.jpsoft.picc.modules.base.entity.InsuranceDefinition">
  46. update base_insurance_definition
  47. <set>
  48. <if test="name!=null">
  49. name_=#{name,jdbcType=VARCHAR},
  50. </if>
  51. <if test="insuranceDescription!=null">
  52. insurance_description=#{insuranceDescription,jdbcType=VARCHAR},
  53. </if>
  54. <if test="clause!=null">
  55. clause_=#{clause,jdbcType=VARCHAR},
  56. </if>
  57. <if test="status!=null">
  58. status_=#{status,jdbcType=VARCHAR},
  59. </if>
  60. <if test="delFlag!=null">
  61. del_flag=#{delFlag,jdbcType= NUMERIC },
  62. </if>
  63. <if test="createBy!=null">
  64. create_by=#{createBy,jdbcType=VARCHAR},
  65. </if>
  66. <if test="createTime!=null">
  67. create_time=#{createTime,jdbcType= TIMESTAMP },
  68. </if>
  69. <if test="updateBy!=null">
  70. update_by=#{updateBy,jdbcType=VARCHAR},
  71. </if>
  72. <if test="updateTime!=null">
  73. update_time=#{updateTime,jdbcType= TIMESTAMP },
  74. </if>
  75. </set>
  76. where id_=#{id}
  77. </update>
  78. <select id="get" parameterType="string" resultMap="InsuranceDefinitionMap">
  79. select
  80. id_,name_,insurance_description,clause_,status_,del_flag,create_by,create_time,update_by,update_time from base_insurance_definition where id_=#{0}
  81. </select>
  82. <select id="exist" parameterType="string" resultType="int">
  83. select count(*) from base_insurance_definition where id_=#{0}
  84. </select>
  85. <select id="list" resultMap="InsuranceDefinitionMap">
  86. select * from base_insurance_definition where del_flag=false
  87. </select>
  88. <select id="search" parameterType="hashmap" resultMap="InsuranceDefinitionMap">
  89. <![CDATA[
  90. select * from base_insurance_definition
  91. ]]>
  92. <where>
  93. and del_flag = false
  94. <if test="searchParams.id != null">
  95. and ID_ like #{searchParams.id}
  96. </if>
  97. </where>
  98. <foreach item="sort" collection="sortList" open="order by" separator=",">
  99. ${sort.name} ${sort.order}
  100. </foreach>
  101. </select>
  102. </mapper>