1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?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.dayou.mapper.MarketLogMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.dayou.entity.MarketLog">
- <result column="id" property="id" />
- <result column="deleted" property="deleted" />
- <result column="created" property="created" />
- <result column="modified" property="modified" />
- <result column="user_id" property="userId" />
- <result column="task_situation" property="taskSituation" />
- <result column="log_date" property="logDate" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- ml.id,
- ml.deleted,
- ml.created,
- ml.modified,
- ml.user_id, ml.task_situation, ml.log_date
- </sql>
- <select id="getList" resultType="com.dayou.vo.ItemUserLogVO">
- select <include refid="Base_Column_List"/>,u.name as userName
- from market_log ml left join user u on u.id = ml.user_id
- where u.deleted = 0 and ml.deleted = 0
- <choose>
- <when test="startDate!=null">
- and ml.log_date >= #{startDate}
- </when>
- <otherwise>
- and ml.log_date >= date_add(curDate(),INTERVAL -10 DAY)
- </otherwise>
- </choose>
- <choose>
- <when test="endDate!=null">
- and ml.log_date <= #{endDate}
- </when>
- <otherwise>
- and ml.log_date <= curDate()
- </otherwise>
- </choose>
- <if test="userIds!=null and userIds.size!=0">
- and ml.user_id in
- <foreach collection="userIds" open="(" close=")" separator="," item="userId">
- #{userId}
- </foreach>
- </if>
- </select>
- </mapper>
|