| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.matrix.system.hive.dao.SysFollowupDao" > |
| | | <mapper namespace="com.matrix.beauty.followup.dao.SysFollowupDao" > |
| | | <!-- 定义SysFollowup 的复杂关联map --> |
| | | <resultMap type="com.matrix.system.hive.bean.SysFollowup" id="SysFollowupMap"> |
| | | <resultMap type="com.matrix.beauty.followup.entry.SysFollowup" id="SysFollowupMap"> |
| | | <id property="id" column="id" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | |
| | | <result property="orderAbstract" column="order_abstract" /> |
| | | <result property="zans" column="zans" /> |
| | | |
| | | <result property="staffPhoto" column="staffPhoto" /> |
| | | <result property="staffName" column="staffName" /> |
| | | <result property="vipName" column="vipName" /> |
| | | |
| | | <collection property="albums" column="{sourceId=id}" select="com.matrix.system.hive.dao.SysVipAlbumDao.selectBySourceId" /> |
| | | |
| | | <collection property="followupComments" column="{follId=id}" select="com.matrix.system.hive.dao.SysFollowupCommentDao.selectByfollId" ></collection> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectUserByZaqns" resultMap="com.matrix.system.common.dao.SysUsersDao.SysUsersMap" > |
| | | select su_id,su_name from sys_users where FIND_IN_SET(#{zans}, su_id) |
| | | select su_id,su_name from sys_users where FIND_IN_SET(su_id,#{zans}) |
| | | </select> |
| | | |
| | | <!-- 定义SysFollowup 的简单map ,本map不添加其他的关联属性 --> |
| | | <resultMap type="com.matrix.system.hive.bean.SysFollowup" id="SysFollowupSimpleMap"> |
| | | <resultMap type="com.matrix.beauty.followup.entry.SysFollowup" id="SysFollowupSimpleMap"> |
| | | <id property="id" column="id" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <!-- 插入方法 --> |
| | | <insert id="insert" parameterType="com.matrix.system.hive.bean.SysFollowup" |
| | | <insert id="insert" parameterType="com.matrix.beauty.followup.entry.SysFollowup" |
| | | useGeneratedKeys="true" keyProperty="item.id"> |
| | | INSERT INTO sys_followup ( |
| | | <include refid="columns"></include> |
| | |
| | | </delete> |
| | | |
| | | <!-- 根据对象删除--> |
| | | <delete id="deleteByModel" parameterType="com.matrix.system.hive.bean.SysFollowup"> |
| | | <delete id="deleteByModel" parameterType="com.matrix.beauty.followup.entry.SysFollowup"> |
| | | DELETE FROM sys_followup |
| | | <where> |
| | | <include refid="where_sql" ></include> |
| | |
| | | |
| | | |
| | | <select id="selectByAppDto" resultMap="SysFollowupMap"> |
| | | select * from sys_followup |
| | | select a.*, |
| | | b.su_photo as staffPhoto, |
| | | b.su_name as staffName, |
| | | c.vip_name as vipName |
| | | from sys_followup a |
| | | left join sys_users b on a.staff_id= b.su_id |
| | | left join sys_vip_info c on a.vip_id=c.id |
| | | <where> |
| | | and company_id=#{companyId} |
| | | and a.company_id=#{companyId} |
| | | |
| | | <if test="shopId != null "> |
| | | and shop_id=#{shopId} |
| | | and a.shop_id=#{shopId} |
| | | </if> |
| | | <if test="queryType == 1 "> |
| | | and (visible=1 or ( visible!=1 and staff_id=#{selfStaff})) |
| | | and (visible=1 or ( visible!=1 and a.staff_id=#{selfStaff})) |
| | | </if> |
| | | <if test="queryType == 2 "> |
| | | and staff_id=#{selfStaff} |
| | | and a.staff_id=#{selfStaff} |
| | | </if> |
| | | <if test="queryType == 3 "> |
| | | and( visible=1 and staff_id!=#{selfStaff}) |
| | | and( visible=1 and a.staff_id!=#{selfStaff}) |
| | | </if> |
| | | |
| | | <if test="startTime != null "> |
| | | and create_time <![CDATA[ >= ]]> #{startTime} |
| | | and a.create_time <![CDATA[ >= ]]> #{startTime} |
| | | </if> |
| | | <if test="endTime != null "> |
| | | and create_time <![CDATA[ <= ]]> #{endTime} |
| | | and a.create_time <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | |
| | | <if test="vipIds!=null and vipIds.size()!=0"> |
| | | and vip_id in |
| | | and a.vip_id in |
| | | <foreach collection="vipIds" index="index" item="item" open="(" |
| | | separator="," close=")"> |
| | | #{item} |
| | |
| | | </if> |
| | | |
| | | <if test="staffIds!=null and staffIds.size()!=0"> |
| | | and staff_id in |
| | | and a.staff_id in |
| | | <foreach collection="staffIds" index="index" item="item" open="(" |
| | | separator="," close=")"> |
| | | #{item} |
| | |
| | | </where> |
| | | |
| | | |
| | | |
| | | order by a.create_time desc |
| | | |
| | | |
| | | limit ${offset},${limit} |
| | | </select> |
| | | |
| | | <select id="findVipFollowuByPage" resultMap="SysFollowupMap"> |
| | | select a.*, |
| | | b.su_photo as staffPhoto, |
| | | b.su_name as staffName, |
| | | c.vip_name as vipName |
| | | from sys_followup a |
| | | left join sys_users b on a.staff_id= b.su_id |
| | | left join sys_vip_info c on a.vip_id=c.id |
| | | <where> |
| | | and a.company_id=#{companyId} |
| | | and (visible=1 or ( visible!=1 and a.staff_id=#{selfStaff})) |
| | | <if test="vipId!=null"> |
| | | and a.vip_id = #{vipId} |
| | | </if> |
| | | </where> |
| | | order by a.create_time desc |
| | | limit ${offset},${limit} |
| | | </select> |
| | | |
| | | </mapper> |