ApprovalRecord.xml 3.2 KB

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