UserInfoMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.miaxis.app.user.mapper.UserInfoMapper">
  6. <resultMap type="UserInfo" id="UserInfoResult">
  7. <result property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="sex" column="sex" />
  10. <result property="sfzmlx" column="sfzmlx" />
  11. <result property="sfzmhm" column="sfzmhm" />
  12. <result property="crdate" column="crdate" />
  13. <result property="birthday" column="birthday" />
  14. <result property="mobile" column="mobile" />
  15. <result property="password" column="password" />
  16. <result property="wechar" column="wechar" />
  17. <result property="openid" column="openid" />
  18. <result property="inscode" column="inscode" />
  19. <result property="createTime" column="create_time" />
  20. <result property="updateTime" column="update_time" />
  21. <result property="pxcx" column="pxcx" />
  22. </resultMap>
  23. <sql id="selectUserInfoVo">
  24. select id, name, sex, sfzmlx, sfzmhm, crdate, birthday, mobile, password, wechar, openid, inscode, create_time, update_time, pxcx from user_info
  25. </sql>
  26. <select id="selectUserInfoList" parameterType="UserInfo" resultMap="UserInfoResult">
  27. <include refid="selectUserInfoVo"/>
  28. <where>
  29. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  30. <if test="sex != null "> and sex = #{sex}</if>
  31. <if test="sfzmlx != null "> and sfzmlx = #{sfzmlx}</if>
  32. <if test="sfzmhm != null and sfzmhm != ''"> and sfzmhm = #{sfzmhm}</if>
  33. <if test="crdate != null "> and crdate = #{crdate}</if>
  34. <if test="birthday != null "> and birthday = #{birthday}</if>
  35. <if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
  36. <if test="password != null and password != ''"> and password = #{password}</if>
  37. <if test="wechar != null and wechar != ''"> and wechar = #{wechar}</if>
  38. <if test="openid != null and openid != ''"> and openid = #{openid}</if>
  39. <if test="inscode != null and inscode != ''"> and inscode = #{inscode}</if>
  40. <if test="pxcx != null and pxcx != ''"> and pxcx = #{pxcx}</if>
  41. </where>
  42. </select>
  43. <select id="selectUserInfoById" parameterType="Long" resultMap="UserInfoResult">
  44. <include refid="selectUserInfoVo"/>
  45. where id = #{id}
  46. </select>
  47. <insert id="insertUserInfo" parameterType="UserInfo">
  48. insert into user_info
  49. <trim prefix="(" suffix=")" suffixOverrides=",">
  50. <if test="id != null">id,</if>
  51. <if test="name != null">name,</if>
  52. <if test="sex != null">sex,</if>
  53. <if test="sfzmlx != null">sfzmlx,</if>
  54. <if test="sfzmhm != null">sfzmhm,</if>
  55. <if test="crdate != null">crdate,</if>
  56. <if test="birthday != null">birthday,</if>
  57. <if test="mobile != null">mobile,</if>
  58. <if test="password != null">password,</if>
  59. <if test="wechar != null">wechar,</if>
  60. <if test="openid != null">openid,</if>
  61. <if test="inscode != null">inscode,</if>
  62. <if test="createTime != null">create_time,</if>
  63. <if test="updateTime != null">update_time,</if>
  64. <if test="pxcx != null">pxcx,</if>
  65. </trim>
  66. <trim prefix="values (" suffix=")" suffixOverrides=",">
  67. <if test="id != null">#{id},</if>
  68. <if test="name != null">#{name},</if>
  69. <if test="sex != null">#{sex},</if>
  70. <if test="sfzmlx != null">#{sfzmlx},</if>
  71. <if test="sfzmhm != null">#{sfzmhm},</if>
  72. <if test="crdate != null">#{crdate},</if>
  73. <if test="birthday != null">#{birthday},</if>
  74. <if test="mobile != null">#{mobile},</if>
  75. <if test="password != null">#{password},</if>
  76. <if test="wechar != null">#{wechar},</if>
  77. <if test="openid != null">#{openid},</if>
  78. <if test="inscode != null">#{inscode},</if>
  79. <if test="createTime != null">#{createTime},</if>
  80. <if test="updateTime != null">#{updateTime},</if>
  81. <if test="pxcx != null">#{pxcx},</if>
  82. </trim>
  83. </insert>
  84. <update id="updateUserInfo" parameterType="UserInfo">
  85. update user_info
  86. <trim prefix="SET" suffixOverrides=",">
  87. <if test="name != null">name = #{name},</if>
  88. <if test="sex != null">sex = #{sex},</if>
  89. <if test="sfzmlx != null">sfzmlx = #{sfzmlx},</if>
  90. <if test="sfzmhm != null">sfzmhm = #{sfzmhm},</if>
  91. <if test="crdate != null">crdate = #{crdate},</if>
  92. <if test="birthday != null">birthday = #{birthday},</if>
  93. <if test="mobile != null">mobile = #{mobile},</if>
  94. <if test="password != null">password = #{password},</if>
  95. <if test="wechar != null">wechar = #{wechar},</if>
  96. <if test="openid != null">openid = #{openid},</if>
  97. <if test="inscode != null">inscode = #{inscode},</if>
  98. <if test="createTime != null">create_time = #{createTime},</if>
  99. <if test="updateTime != null">update_time = #{updateTime},</if>
  100. <if test="pxcx != null">pxcx = #{pxcx},</if>
  101. </trim>
  102. where id = #{id}
  103. </update>
  104. <delete id="deleteUserInfoById" parameterType="Long">
  105. delete from user_info where id = #{id}
  106. </delete>
  107. <delete id="deleteUserInfoByIds" parameterType="String">
  108. delete from user_info where id in
  109. <foreach item="id" collection="array" open="(" separator="," close=")">
  110. #{id}
  111. </foreach>
  112. </delete>
  113. </mapper>