BisInspAllRlationPersZjDao.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.BisInspAllRlationPersZjDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspAllRlationPersZj" id="bisInspAllRlationPersZjResultMap">
  5. <result property="userCode" column="USER_CODE"/>
  6. <result property="userName" column="USER_NAME"/>
  7. <result property="trueName" column="TRUE_NAME"/>
  8. <result property="mobile" column="MOBILE"/>
  9. <result property="mail" column="MAIL"/>
  10. <result property="isAdmin" column="IS_ADMIN"/>
  11. <result property="adcd" column="ADCD"/>
  12. <result property="adName" column="AD_NAME"/>
  13. <result property="avatar" column="AVATAR"/>
  14. <result property="modifyTime" column="MODIFY_TIME"/>
  15. </resultMap>
  16. <sql id="table_columns">
  17. USER_CODE,
  18. USER_NAME,
  19. TRUE_NAME,
  20. MOBILE,
  21. MAIL,
  22. IS_ADMIN,
  23. ADCD,
  24. AD_NAME,
  25. AVATAR,
  26. MODIFY_TIME
  27. </sql>
  28. <sql id="entity_properties">
  29. #{userCode},
  30. #{userName},
  31. #{trueName},
  32. #{mobile},
  33. #{mail},
  34. #{isAdmin},
  35. #{adcd},
  36. #{adName},
  37. #{avatar},
  38. #{modifyTime}
  39. </sql>
  40. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  41. <sql id="page_where">
  42. <trim prefix="where" prefixOverrides="and | or ">
  43. <if test="userName != null and userName != ''">and USER_NAME = #{userName}</if>
  44. <if test="trueName != null and trueName != ''">and TRUE_NAME = #{trueName}</if>
  45. <if test="mobile != null and mobile != ''">and MOBILE = #{mobile}</if>
  46. <if test="mail != null and mail != ''">and MAIL = #{mail}</if>
  47. <if test="isAdmin != null and isAdmin != ''">and IS_ADMIN = #{isAdmin}</if>
  48. <if test="adcd != null and adcd != ''">and ADCD = #{adcd}</if>
  49. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  50. <if test="avatar != null and avatar != ''">and AVATAR = #{avatar}</if>
  51. <if test="modifyTime != null">and MODIFY_TIME = #{modifyTime}</if>
  52. </trim>
  53. </sql>
  54. <select id="get" resultMap="bisInspAllRlationPersZjResultMap" parameterType="String" >
  55. select <include refid="table_columns" /> from BIS_INSP_ALL_RLATION_PERS_ZJ where USER_CODE = #{userCode}
  56. </select>
  57. <select id="getBy" resultMap="bisInspAllRlationPersZjResultMap">
  58. select <include refid="table_columns" /> from BIS_INSP_ALL_RLATION_PERS_ZJ <include refid="page_where" />
  59. </select>
  60. <select id="findAll" resultMap="bisInspAllRlationPersZjResultMap">
  61. select <include refid="table_columns" /> from BIS_INSP_ALL_RLATION_PERS_ZJ
  62. </select>
  63. <select id="findList" resultMap="bisInspAllRlationPersZjResultMap">
  64. select <include refid="table_columns" /> from BIS_INSP_ALL_RLATION_PERS_ZJ <include refid="page_where" />
  65. </select>
  66. <select id="selectCount" resultType="int" >
  67. select count(USER_CODE) from BIS_INSP_ALL_RLATION_PERS_ZJ where USER_CODE = #{userCode}
  68. </select>
  69. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspAllRlationPersZj">
  70. insert into BIS_INSP_ALL_RLATION_PERS_ZJ( <include refid="table_columns" /> )
  71. values ( <include refid="entity_properties" /> )
  72. </insert>
  73. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspAllRlationPersZj">
  74. update BIS_INSP_ALL_RLATION_PERS_ZJ
  75. <trim prefix="set" suffixOverrides=",">
  76. <if test="userName != null and userName != ''">USER_NAME = #{userName},</if>
  77. <if test="trueName != null and trueName != ''">TRUE_NAME = #{trueName},</if>
  78. <if test="mobile != null and mobile != ''">MOBILE = #{mobile},</if>
  79. <if test="mail != null and mail != ''">MAIL = #{mail},</if>
  80. <if test="isAdmin != null and isAdmin != ''">IS_ADMIN = #{isAdmin},</if>
  81. <if test="adcd != null and adcd != ''">ADCD = #{adcd},</if>
  82. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  83. <if test="avatar != null and avatar != ''">AVATAR = #{avatar},</if>
  84. <if test="modifyTime != null">MODIFY_TIME = #{modifyTime},</if>
  85. </trim>
  86. <where>USER_CODE = #{userCode}</where>
  87. </update>
  88. <!-- 其他自定义SQL -->
  89. </mapper>