SysUserDao.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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.sckw.system.dao.SysUserDao">
  4. <resultMap id="BaseResultMap" type="com.sckw.system.model.SysUser">
  5. <result column="id" property="id" />
  6. <result column="system_type" property="systemType" />
  7. <result column="account" property="account" />
  8. <result column="password" property="password" />
  9. <result column="name" property="name" />
  10. <result column="telephone" property="telephone" />
  11. <result column="photo" property="photo" />
  12. <result column="email" property="email" />
  13. <result column="is_main" property="isMain" />
  14. <result column="remark" property="remark" />
  15. <result column="status" property="status" />
  16. <result column="create_by" property="createBy" />
  17. <result column="create_time" property="createTime" />
  18. <result column="update_by" property="updateBy" />
  19. <result column="update_time" property="updateTime" />
  20. <result column="del_flag" property="delFlag" />
  21. </resultMap>
  22. <insert id="cunstomtest" parameterType="com.sckw.system.model.KwsEntType">
  23. insert into kws_ent_type
  24. <trim prefix="(" suffix=")" suffixOverrides=",">
  25. <if test="id != null">
  26. id,
  27. </if>
  28. <if test="entId != null">
  29. ent_id,
  30. </if>
  31. <if test="type != null">
  32. type,
  33. </if>
  34. <if test="remark != null">
  35. remark,
  36. </if>
  37. <if test="status != null">
  38. status,
  39. </if>
  40. <if test="createBy != null">
  41. create_by,
  42. </if>
  43. <if test="createTime != null">
  44. create_time,
  45. </if>
  46. <if test="updateBy != null">
  47. update_by,
  48. </if>
  49. <if test="updateTime != null">
  50. update_time,
  51. </if>
  52. <if test="delFlag != null">
  53. del_flag,
  54. </if>
  55. </trim>
  56. <trim prefix="values (" suffix=")" suffixOverrides=",">
  57. <if test="id != null">
  58. #{id,jdbcType=BIGINT},
  59. </if>
  60. <if test="entId != null">
  61. #{entId,jdbcType=BIGINT},
  62. </if>
  63. <if test="type != null">
  64. #{type,jdbcType=INTEGER},
  65. </if>
  66. <if test="remark != null">
  67. #{remark,jdbcType=VARCHAR},
  68. </if>
  69. <if test="status != null">
  70. #{status,jdbcType=INTEGER},
  71. </if>
  72. <if test="createBy != null">
  73. #{createBy,jdbcType=BIGINT},
  74. </if>
  75. <if test="createTime != null">
  76. #{createTime,jdbcType=TIMESTAMP},
  77. </if>
  78. <if test="updateBy != null">
  79. #{updateBy,jdbcType=BIGINT},
  80. </if>
  81. <if test="updateTime != null">
  82. #{updateTime,jdbcType=TIMESTAMP},
  83. </if>
  84. <if test="delFlag != null">
  85. #{delFlag,jdbcType=INTEGER},
  86. </if>
  87. </trim>
  88. </insert>
  89. <select id="findByAccount" parameterType="java.util.Map" resultType="com.sckw.system.model.SysUser">
  90. SELECT
  91. id, system_type systemType, account, password, name, telephone, photo, email, is_main isMain,
  92. remark, status, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime
  93. FROM
  94. sys_user
  95. where del_flag = 0
  96. <if test="systemType != null and systemType != ''">
  97. and system_type = #{systemType, jdbcType=VARCHAR}
  98. </if>
  99. <if test="account != null and account != ''">
  100. and account = #{account, jdbcType=VARCHAR}
  101. </if>
  102. </select>
  103. <select id="findPage" resultType="java.util.Map" parameterType="java.util.Map" >
  104. SELECT
  105. id, system_type systemType, account, password, name, telephone, photo, email, is_main isMain,
  106. remark, status, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime
  107. FROM
  108. sys_user u
  109. where del_flag = 0
  110. <if test="systemType != null and systemType != ''">
  111. and d.system_type = #{systemType, jdbcType=VARCHAR}
  112. </if>
  113. <if test="account != null and account != ''">
  114. and account = #{account, jdbcType=VARCHAR}
  115. </if>
  116. ORDER BY create_time desc
  117. </select>
  118. </mapper>