StaffMapper.xml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.mdd.common.mapper.staff.StaffMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.mdd.common.entity.staff.Staff">
  6. <!-- <id column="id" property="id"/>
  7. <result column="create_id" property="createId"/>
  8. <result column="create_time" property="createTime"/>
  9. <result column="update_id" property="updateId"/>
  10. <result column="update_time" property="updateTime"/>
  11. <result column="company_id" property="companyId"/>
  12. <result column="account_id" property="accountId"/>
  13. <result column="account_chart_id" property="accountChartId"/>
  14. <result column="is_add_next_level" property="isAddNextLevel"/>
  15. <result column="is_reallocate" property="isReallocate"/>
  16. <result column="tenant_id" property="tenantId"/>-->
  17. </resultMap>
  18. <select id="page" resultType="com.mdd.common.dto.result.StaffResultDto">
  19. select a.id,
  20. a.user_id as userId,
  21. a.sn,
  22. a.name,
  23. a.sex,
  24. a.mobile,
  25. a.goods_ids as goodsIds,
  26. a.province_id as provinceId,
  27. a.city_id as cityId,
  28. a.district_id as districtId,
  29. a.address,
  30. a.longitude,
  31. a.latitude,
  32. a.status,
  33. a.is_recommend as isRecommend,
  34. a.create_time as createTime,
  35. a.update_time as updateTime,
  36. b.sn as userSn,
  37. b.avatar as avatarUri,
  38. b.nickname,
  39. b.username,
  40. b.mobile
  41. from la_staff a
  42. left join la_user b on a.user_id = b.id
  43. <where>
  44. a.is_delete = 0
  45. <if test="form.status != null">
  46. and a.status = #{form.status}
  47. </if>
  48. <if test="form.userInfo != null and form.userInfo != ''">
  49. and (b.nickname like concat('%', #{form.userInfo}, '%') or
  50. b.mobile like concat('%', #{form.userInfo}, '%') or
  51. b.username like concat('%', #{form.userInfo}, '%'))
  52. </if>
  53. <if test="form.staffInfo != null and form.staffInfo != ''">
  54. and (a.name like concat('%', #{form.staffInfo}, '%')
  55. or a.mobile like concat('%', #{form.staffInfo}, '%'))
  56. </if>
  57. <if test="form.isRecommend != null">
  58. and a.is_recommend = #{form.isRecommend}
  59. </if>
  60. <if test="form.provinceId != null">
  61. and a.province_id = #{form.provinceId}
  62. </if>
  63. <if test="form.cityId != null">
  64. and a.city_id = #{form.cityId }
  65. </if>
  66. <if test="form.districtId != null">
  67. and a.district_id = #{form.districtId}
  68. </if>
  69. </where>
  70. order by a.create_time desc
  71. </select>
  72. </mapper>