ServiceApprove.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.dao.ServiceApproveDAO">
  6. <resultMap id="ServiceApproveMap" type="com.jpsoft.employment.modules.base.entity.ServiceApprove">
  7. <id property="id" column="id_" />
  8. <result property="serviceId" column="service_id" />
  9. <result property="type" column="type_" />
  10. <result property="approveStatus" column="approve_status" />
  11. <result property="companyId" column="company_id" />
  12. <result property="approvePersonId" column="approve_person_id" />
  13. <result property="approveTime" column="approve_time" />
  14. <result property="createBy" column="create_by" />
  15. <result property="createTime" column="create_time" />
  16. <result property="updateBy" column="update_by" />
  17. <result property="updateTime" column="update_time" />
  18. <result property="delFlag" column="del_flag" />
  19. </resultMap>
  20. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.ServiceApprove">
  21. <!--
  22. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  23. select sys_guid() from dual
  24. </selectKey>
  25. -->
  26. <![CDATA[
  27. insert into base_service_approve
  28. (id_,service_id,type_,approve_status,company_id,approve_person_id,approve_time,create_by,create_time,update_by,update_time,del_flag)
  29. values
  30. (
  31. #{id,jdbcType=VARCHAR}
  32. ,#{serviceId,jdbcType=VARCHAR}
  33. ,#{type,jdbcType=VARCHAR}
  34. ,#{approveStatus,jdbcType=VARCHAR}
  35. ,#{companyId,jdbcType=VARCHAR}
  36. ,#{approvePersonId,jdbcType=VARCHAR}
  37. ,#{approveTime,jdbcType= TIMESTAMP }
  38. ,#{createBy,jdbcType=VARCHAR}
  39. ,#{createTime,jdbcType= TIMESTAMP }
  40. ,#{updateBy,jdbcType=VARCHAR}
  41. ,#{updateTime,jdbcType= TIMESTAMP }
  42. ,#{delFlag,jdbcType= NUMERIC }
  43. )
  44. ]]>
  45. </insert>
  46. <delete id="delete" parameterType="string">
  47. delete from base_service_approve where id_=#{id,jdbcType=VARCHAR}
  48. </delete>
  49. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.ServiceApprove">
  50. update base_service_approve
  51. <set>
  52. <if test="serviceId!=null">
  53. service_id=#{serviceId,jdbcType=VARCHAR},
  54. </if>
  55. <if test="type!=null">
  56. type_=#{type,jdbcType=VARCHAR},
  57. </if>
  58. <if test="approveStatus!=null">
  59. approve_status=#{approveStatus,jdbcType=VARCHAR},
  60. </if>
  61. <if test="companyId!=null">
  62. company_id=#{companyId,jdbcType=VARCHAR},
  63. </if>
  64. <if test="approvePersonId!=null">
  65. approve_person_id=#{approvePersonId,jdbcType=VARCHAR},
  66. </if>
  67. <if test="approveTime!=null">
  68. approve_time=#{approveTime,jdbcType= TIMESTAMP },
  69. </if>
  70. <if test="createBy!=null">
  71. create_by=#{createBy,jdbcType=VARCHAR},
  72. </if>
  73. <if test="createTime!=null">
  74. create_time=#{createTime,jdbcType= TIMESTAMP },
  75. </if>
  76. <if test="updateBy!=null">
  77. update_by=#{updateBy,jdbcType=VARCHAR},
  78. </if>
  79. <if test="updateTime!=null">
  80. update_time=#{updateTime,jdbcType= TIMESTAMP },
  81. </if>
  82. <if test="delFlag!=null">
  83. del_flag=#{delFlag,jdbcType= NUMERIC },
  84. </if>
  85. </set>
  86. where id_=#{id}
  87. </update>
  88. <select id="get" parameterType="string" resultMap="ServiceApproveMap">
  89. select
  90. id_,service_id,type_,approve_status,company_id,approve_person_id,approve_time,create_by,create_time,update_by,update_time,del_flag from base_service_approve where id_=#{0}
  91. </select>
  92. <select id="exist" parameterType="string" resultType="int">
  93. select count(*) from base_service_approve where id_=#{0}
  94. </select>
  95. <select id="list" resultMap="ServiceApproveMap">
  96. select * from base_service_approve
  97. </select>
  98. <select id="search" parameterType="hashmap" resultMap="ServiceApproveMap">
  99. <![CDATA[
  100. select * from base_service_approve
  101. ]]>
  102. <where>
  103. <if test="searchParams.id != null">
  104. and ID_ like #{searchParams.id}
  105. </if>
  106. </where>
  107. <foreach item="sort" collection="sortList" open="order by" separator=",">
  108. ${sort.name} ${sort.order}
  109. </foreach>
  110. </select>
  111. </mapper>