ArgonPartner.xml 4.0 KB

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