TechWebsiteMapper.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.goafanti.common.dao.TechWebsiteMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TechWebsite" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="department" property="department" jdbcType="VARCHAR" />
  8. <result column="website" property="website" jdbcType="VARCHAR" />
  9. <result column="account_number" property="accountNumber" jdbcType="VARCHAR" />
  10. <result column="password" property="password" jdbcType="VARCHAR" />
  11. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  12. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  13. </resultMap>
  14. <sql id="Base_Column_List" >
  15. id, uid, department, website, account_number, password, create_time, deleted_sign
  16. </sql>
  17. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  18. select
  19. <include refid="Base_Column_List" />
  20. from tech_website
  21. where id = #{id,jdbcType=VARCHAR}
  22. </select>
  23. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  24. delete from tech_website
  25. where id = #{id,jdbcType=VARCHAR}
  26. </delete>
  27. <insert id="insert" parameterType="com.goafanti.common.model.TechWebsite" >
  28. insert into tech_website (id, uid, department,
  29. website, account_number, password,
  30. create_time, deleted_sign)
  31. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR},
  32. #{website,jdbcType=VARCHAR}, #{accountNumber,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
  33. #{createTime,jdbcType=TIMESTAMP}, #{deletedSign,jdbcType=INTEGER})
  34. </insert>
  35. <insert id="insertSelective" parameterType="com.goafanti.common.model.TechWebsite" >
  36. insert into tech_website
  37. <trim prefix="(" suffix=")" suffixOverrides="," >
  38. <if test="id != null" >
  39. id,
  40. </if>
  41. <if test="uid != null" >
  42. uid,
  43. </if>
  44. <if test="department != null" >
  45. department,
  46. </if>
  47. <if test="website != null" >
  48. website,
  49. </if>
  50. <if test="accountNumber != null" >
  51. account_number,
  52. </if>
  53. <if test="password != null" >
  54. password,
  55. </if>
  56. <if test="createTime != null" >
  57. create_time,
  58. </if>
  59. <if test="deletedSign != null" >
  60. deleted_sign,
  61. </if>
  62. </trim>
  63. <trim prefix="values (" suffix=")" suffixOverrides="," >
  64. <if test="id != null" >
  65. #{id,jdbcType=VARCHAR},
  66. </if>
  67. <if test="uid != null" >
  68. #{uid,jdbcType=VARCHAR},
  69. </if>
  70. <if test="department != null" >
  71. #{department,jdbcType=VARCHAR},
  72. </if>
  73. <if test="website != null" >
  74. #{website,jdbcType=VARCHAR},
  75. </if>
  76. <if test="accountNumber != null" >
  77. #{accountNumber,jdbcType=VARCHAR},
  78. </if>
  79. <if test="password != null" >
  80. #{password,jdbcType=VARCHAR},
  81. </if>
  82. <if test="createTime != null" >
  83. #{createTime,jdbcType=TIMESTAMP},
  84. </if>
  85. <if test="deletedSign != null" >
  86. #{deletedSign,jdbcType=INTEGER},
  87. </if>
  88. </trim>
  89. </insert>
  90. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TechWebsite" >
  91. update tech_website
  92. <set >
  93. <if test="uid != null" >
  94. uid = #{uid,jdbcType=VARCHAR},
  95. </if>
  96. <if test="department != null" >
  97. department = #{department,jdbcType=VARCHAR},
  98. </if>
  99. <if test="website != null" >
  100. website = #{website,jdbcType=VARCHAR},
  101. </if>
  102. <if test="accountNumber != null" >
  103. account_number = #{accountNumber,jdbcType=VARCHAR},
  104. </if>
  105. <if test="password != null" >
  106. password = #{password,jdbcType=VARCHAR},
  107. </if>
  108. <if test="createTime != null" >
  109. create_time = #{createTime,jdbcType=TIMESTAMP},
  110. </if>
  111. <if test="deletedSign != null" >
  112. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  113. </if>
  114. </set>
  115. where id = #{id,jdbcType=VARCHAR}
  116. </update>
  117. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TechWebsite" >
  118. update tech_website
  119. set uid = #{uid,jdbcType=VARCHAR},
  120. department = #{department,jdbcType=VARCHAR},
  121. website = #{website,jdbcType=VARCHAR},
  122. account_number = #{accountNumber,jdbcType=VARCHAR},
  123. password = #{password,jdbcType=VARCHAR},
  124. create_time = #{createTime,jdbcType=TIMESTAMP},
  125. deleted_sign = #{deletedSign,jdbcType=INTEGER}
  126. where id = #{id,jdbcType=VARCHAR}
  127. </update>
  128. <select id="selectTechWebsiteByUid" resultMap="BaseResultMap" parameterType="java.lang.String" >
  129. select
  130. <include refid="Base_Column_List" />
  131. from tech_website
  132. where uid = #{uid,jdbcType=VARCHAR} and deleted_sign = 0
  133. </select>
  134. <select id="findTechWebsiteListByPage" resultType="com.goafanti.techproject.bo.TechWebsiteListBo" parameterType="java.lang.String" >
  135. select
  136. w.id,
  137. w.uid,
  138. i.unit_name as unitName,
  139. i.licence_province as province,
  140. w.department,
  141. w.website,
  142. w.account_number as accountNumber,
  143. w.password
  144. from tech_website w
  145. LEFT JOIN organization_identity i on w.uid = i.uid
  146. where w.deleted_sign = 0
  147. <if test="province != null">
  148. and i.licence_province = #{province,jdbcType=INTEGER}
  149. </if>
  150. <if test="unitName != null" >
  151. and i.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
  152. </if>
  153. order by w.create_time desc
  154. <if test="page_sql!=null">
  155. ${page_sql}
  156. </if>
  157. </select>
  158. <select id="findTechWebsiteCount" resultType="java.lang.Integer" parameterType="String">
  159. select count(1)
  160. from tech_website w
  161. LEFT JOIN organization_identity i on w.uid = i.uid
  162. where w.deleted_sign = 0
  163. <if test="province != null">
  164. and i.licence_province = #{province,jdbcType=INTEGER}
  165. </if>
  166. <if test="unitName != null" >
  167. and i.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
  168. </if>
  169. </select>
  170. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  171. update tech_website set deleted_sign = 1
  172. where id in
  173. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  174. #{item}
  175. </foreach>
  176. </update>
  177. <select id="selectTechWebsiteDetail" resultType="com.goafanti.techproject.bo.TechWebsiteDetailBo" parameterType="java.lang.String" >
  178. SELECT t.id, t.account_number as accountNumber, t.department,t.password, t.uid, t.website, i.unit_name as unitName
  179. from tech_website t LEFT JOIN organization_identity i on t.uid = i.uid
  180. where t.id = #{id,jdbcType=VARCHAR}
  181. </select>
  182. </mapper>