12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.mdd.common.mapper.staff.StaffMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.mdd.common.entity.staff.Staff">
- <!-- <id column="id" property="id"/>
- <result column="create_id" property="createId"/>
- <result column="create_time" property="createTime"/>
- <result column="update_id" property="updateId"/>
- <result column="update_time" property="updateTime"/>
- <result column="company_id" property="companyId"/>
- <result column="account_id" property="accountId"/>
- <result column="account_chart_id" property="accountChartId"/>
- <result column="is_add_next_level" property="isAddNextLevel"/>
- <result column="is_reallocate" property="isReallocate"/>
- <result column="tenant_id" property="tenantId"/>-->
- </resultMap>
- <select id="page" resultType="com.mdd.common.dto.result.StaffResultDto">
- select a.id,
- a.user_id as userId,
- a.sn,
- a.name,
- a.sex,
- a.mobile,
- a.goods_ids as goodsIds,
- a.province_id as provinceId,
- a.city_id as cityId,
- a.district_id as districtId,
- a.address,
- a.longitude,
- a.latitude,
- a.status,
- a.is_recommend as isRecommend,
- a.create_time as createTime,
- a.update_time as updateTime,
- b.sn as userSn,
- b.avatar as avatarUri,
- b.nickname,
- b.username,
- b.mobile
- from la_staff a
- left join la_user b on a.user_id = b.id
- <where>
- a.is_delete = 0
- <if test="form.status != null">
- and a.status = #{form.status}
- </if>
- <if test="form.userInfo != null and form.userInfo != ''">
- and (b.nickname like concat('%', #{form.userInfo}, '%') or
- b.mobile like concat('%', #{form.userInfo}, '%') or
- b.username like concat('%', #{form.userInfo}, '%'))
- </if>
- <if test="form.staffInfo != null and form.staffInfo != ''">
- and (a.name like concat('%', #{form.staffInfo}, '%')
- or a.mobile like concat('%', #{form.staffInfo}, '%'))
- </if>
- <if test="form.isRecommend != null">
- and a.is_recommend = #{form.isRecommend}
- </if>
- <if test="form.provinceId != null">
- and a.province_id = #{form.provinceId}
- </if>
- <if test="form.cityId != null">
- and a.city_id = #{form.cityId }
- </if>
- <if test="form.districtId != null">
- and a.district_id = #{form.districtId}
- </if>
- </where>
- order by a.create_time desc
- </select>
- </mapper>
|