InsuranceAgent.xml 3.1 KB

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