ArgonPartner.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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.modules.base.dao.ArgonPartnerDAO">
  6. <resultMap id="ArgonPartnerMap" type="com.jpsoft.employment.modules.base.entity.ArgonPartner">
  7. <id property="id" column="id_" />
  8. <result property="name" column="name_" />
  9. <result property="location" column="location_" />
  10. <result property="contact" column="contact_" />
  11. <result property="phone" column="phone_" />
  12. <result property="introduction" column="introduction_" />
  13. <result property="createTime" column="create_time" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="createBy" column="create_by" />
  16. <result property="updateBy" column="update_by" />
  17. <result property="delFlag" column="del_flag" />
  18. <result property="customerId" column="customer_id" />
  19. </resultMap>
  20. <insert id="insert" parameterType="ArgonPartner">
  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_argon_partner
  28. (id_,name_,location_,contact_,phone_,introduction_,create_time,update_time,create_by,update_by,del_flag,customer_id)
  29. values
  30. (
  31. #{id,jdbcType=VARCHAR}
  32. ,#{name,jdbcType=VARCHAR}
  33. ,#{location,jdbcType=VARCHAR}
  34. ,#{contact,jdbcType=VARCHAR}
  35. ,#{phone,jdbcType=VARCHAR}
  36. ,#{introduction,jdbcType=VARCHAR}
  37. ,#{createTime,jdbcType= TIMESTAMP }
  38. ,#{updateTime,jdbcType= TIMESTAMP }
  39. ,#{createBy,jdbcType=VARCHAR}
  40. ,#{updateBy,jdbcType=VARCHAR}
  41. ,#{delFlag,jdbcType= NUMERIC }
  42. ,#{customerId,jdbcType=VARCHAR}
  43. )
  44. ]]>
  45. </insert>
  46. <delete id="delete" parameterType="string">
  47. delete from base_argon_partner where id_=#{id,jdbcType=VARCHAR}
  48. </delete>
  49. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.ArgonPartner">
  50. update base_argon_partner
  51. <set>
  52. <if test="name!=null">
  53. name_=#{name,jdbcType=VARCHAR},
  54. </if>
  55. <if test="location!=null">
  56. location_=#{location,jdbcType=VARCHAR},
  57. </if>
  58. <if test="contact!=null">
  59. contact_=#{contact,jdbcType=VARCHAR},
  60. </if>
  61. <if test="phone!=null">
  62. phone_=#{phone,jdbcType=VARCHAR},
  63. </if>
  64. <if test="introduction!=null">
  65. introduction_=#{introduction,jdbcType=VARCHAR},
  66. </if>
  67. <if test="createTime!=null">
  68. create_time=#{createTime,jdbcType= TIMESTAMP },
  69. </if>
  70. <if test="updateTime!=null">
  71. update_time=#{updateTime,jdbcType= TIMESTAMP },
  72. </if>
  73. <if test="createBy!=null">
  74. create_by=#{createBy,jdbcType=VARCHAR},
  75. </if>
  76. <if test="updateBy!=null">
  77. update_by=#{updateBy,jdbcType=VARCHAR},
  78. </if>
  79. <if test="delFlag!=null">
  80. del_flag=#{delFlag,jdbcType= NUMERIC },
  81. </if>
  82. <if test="customerId!=null">
  83. customer_id=#{customerId,jdbcType=VARCHAR},
  84. </if>
  85. </set>
  86. where id_=#{id}
  87. </update>
  88. <select id="get" parameterType="string" resultMap="ArgonPartnerMap">
  89. select * from base_argon_partner where id_=#{0}
  90. </select>
  91. <select id="exist" parameterType="string" resultType="int">
  92. select count(*) from base_argon_partner where id_=#{0}
  93. </select>
  94. <select id="list" resultMap="ArgonPartnerMap">
  95. select * from base_argon_partner
  96. </select>
  97. <select id="findByCustomerId" resultMap="ArgonPartnerMap">
  98. select * from base_argon_partner where del_flag=false and customer_id=#{0}
  99. </select>
  100. <select id="search" parameterType="hashmap" resultMap="ArgonPartnerMap">
  101. <![CDATA[
  102. select * from base_argon_partner
  103. ]]>
  104. <where>
  105. del_flag=false
  106. <if test="searchParams.id != null">
  107. and ID_ like #{searchParams.id}
  108. </if>
  109. </where>
  110. <foreach item="sort" collection="sortList" open="order by" separator=",">
  111. ${sort.name} ${sort.order}
  112. </foreach>
  113. </select>
  114. <select id="searchMobile" parameterType="hashmap" resultMap="ArgonPartnerMap">
  115. <![CDATA[
  116. select * from base_argon_partner
  117. ]]>
  118. <where>
  119. del_flag=false
  120. <if test="searchParams.id != null">
  121. and ID_ like #{searchParams.id}
  122. </if>
  123. </where>
  124. <foreach item="sort" collection="sortList" open="order by" separator=",">
  125. ${sort.name} ${sort.order}
  126. </foreach>
  127. </select>
  128. </mapper>