AttUserExtDao.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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="cn.com.goldenwater.dcproj.dao.AttUserExtDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttUserExt" id="attUserExtResultMap">
  5. <result property="guid" column="GUID"/>
  6. <result property="userName" column="USER_NAME"/>
  7. <result property="password" column="PASSWORD"/>
  8. <result property="userType" column="USER_TYPE"/>
  9. <result property="persId" column="PERS_ID"/>
  10. <result property="status" column="STATUS"/>
  11. <result property="modifier" column="MODIFIER"/>
  12. <result property="ts" column="TS"/>
  13. <result property="note" column="NOTE"/>
  14. </resultMap>
  15. <sql id="table_columns">
  16. GUID,
  17. USER_NAME,
  18. PASSWORD,
  19. USER_TYPE,
  20. PERS_ID,
  21. STATUS,
  22. MODIFIER,
  23. TS,
  24. NOTE
  25. </sql>
  26. <sql id="entity_properties">
  27. #{guid},
  28. #{userName},
  29. #{password},
  30. #{userType},
  31. #{persId},
  32. #{status},
  33. #{modifier},
  34. #{ts},
  35. #{note}
  36. </sql>
  37. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  38. <sql id="page_where">
  39. <trim prefix="where" prefixOverrides="and | or ">
  40. <if test="userName != null and userName != ''">and USER_NAME = #{userName}</if>
  41. <if test="password != null and password != ''">and PASSWORD = #{password}</if>
  42. <if test="userType != null and userType != ''">and USER_TYPE = #{userType}</if>
  43. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  44. <if test="status != null and status != ''">and STATUS = #{status}</if>
  45. <if test="modifier != null and modifier != ''">and MODIFIER = #{modifier}</if>
  46. <if test="ts != null">and TS = #{ts}</if>
  47. <if test="note != null and note != ''">and NOTE = #{note}</if>
  48. </trim>
  49. </sql>
  50. <select id="get" resultMap="attUserExtResultMap" parameterType="String" >
  51. select <include refid="table_columns" /> from att_user_ext where GUID = #{id}
  52. </select>
  53. <select id="getBy" resultMap="attUserExtResultMap">
  54. select <include refid="table_columns" /> from att_user_ext <include refid="page_where" />
  55. </select>
  56. <select id="findAll" resultMap="attUserExtResultMap">
  57. select <include refid="table_columns" /> from att_user_ext
  58. </select>
  59. <select id="findList" resultMap="attUserExtResultMap">
  60. select <include refid="table_columns" /> from att_user_ext <include refid="page_where" />
  61. </select>
  62. <select id="selectCount" resultType="int" >
  63. select count(GUID) from att_user_ext <include refid="page_where" />
  64. </select>
  65. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttUserExt">
  66. insert into att_user_ext( <include refid="table_columns" /> )
  67. values ( <include refid="entity_properties" /> )
  68. </insert>
  69. <delete id="delete" parameterType="java.lang.String">
  70. delete from att_user_ext where GUID = #{id}
  71. </delete>
  72. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttUserExt">
  73. delete from att_user_ext <include refid="page_where" />
  74. </delete>
  75. <update id="deleteInFlag" parameterType="java.lang.String">
  76. update att_user_ext set flag_valid = 0 where GUID = #{id}
  77. </update>
  78. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttUserExt">
  79. update att_user_ext
  80. <trim prefix="set" suffixOverrides=",">
  81. <if test="userName != null and userName != ''">USER_NAME = #{userName},</if>
  82. <if test="password != null and password != ''">PASSWORD = #{password},</if>
  83. <if test="userType != null and userType != ''">USER_TYPE = #{userType},</if>
  84. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  85. <if test="status != null and status != ''">STATUS = #{status},</if>
  86. <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
  87. <if test="ts != null">TS = #{ts},</if>
  88. <if test="note != null and note != ''">NOTE = #{note},</if>
  89. </trim>
  90. <where>GUID = #{id}</where>
  91. </update>
  92. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttUserExt">
  93. update att_user_ext
  94. <trim prefix="set" suffixOverrides=",">
  95. <if test="userName != null and userName != ''">USER_NAME = #{userName},</if>
  96. <if test="password != null and password != ''">PASSWORD = #{password},</if>
  97. <if test="userType != null and userType != ''">USER_TYPE = #{userType},</if>
  98. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  99. <if test="status != null and status != ''">STATUS = #{status},</if>
  100. <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
  101. <if test="ts != null">TS = #{ts},</if>
  102. <if test="note != null and note != ''">NOTE = #{note},</if>
  103. </trim>
  104. <include refid="page_where" />
  105. </update>
  106. <!-- 其他自定义SQL -->
  107. </mapper>