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="cn.com.ty.lift.enterprise.oa.mapper.AttendanceMapper" >
- <resultMap id="BaseResultMap" type="AttendanceResponse" >
- <id column="id" property="id" jdbcType="BIGINT" />
- <result column="mt_company_id" property="mtCompanyId" jdbcType="BIGINT" />
- <result column="user_id" property="userId" jdbcType="BIGINT" />
- <result column="coordinate" property="coordinate" jdbcType="VARCHAR" />
- <result column="remarks" property="remarks" jdbcType="VARCHAR" />
- <result column="address" property="address" jdbcType="VARCHAR" />
- <result column="creator_id" property="creatorId" jdbcType="BIGINT" />
- <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
- <result column="update_id" property="updateId" jdbcType="BIGINT" />
- <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
- <result column="status" property="status" jdbcType="INTEGER" />
- <result column="type" property="type" jdbcType="INTEGER" />
- <result column="username" property="username" jdbcType="VARCHAR" />
- </resultMap>
- <!--根据条件分页查询-->
- <select id="pageByCondition" resultMap="BaseResultMap" parameterType="cn.com.ty.lift.enterprise.oa.dto.AttendanceRequest">
- SELECT
- att.*,
- ui.name AS username
- FROM attendance att
- LEFT JOIN user_info ui ON att.user_id = ui.user_id
- <where>
- <if test="cond.username != null and cond.username != ''">
- AND ui.name LIKE concat('%',#{cond.username},'%')
- </if>
- <if test="cond.mtCompanyId != null and cond.mtCompanyId > 0">
- AND att.mt_company_id = #{cond.mtCompanyId}
- </if>
- <if test="cond.begin != null">
- AND date(att.create_date) >= #{cond.begin}
- </if>
- <if test="cond.end != null">
- AND date(att.create_date) <= #{cond.end}
- </if>
- </where>
- </select>
- <select id="pageByUser" resultMap="BaseResultMap" parameterType="cn.com.ty.lift.enterprise.oa.dto.AttendanceRequest">
- SELECT
- att.*,
- ui.name AS username
- FROM attendance att
- LEFT JOIN user_info ui ON att.user_id = ui.user_id
- <where>
- <if test="cond.userId != null">
- AND ui.user_id LIKE #{cond.userId}
- </if>
- <if test="cond.begin != null">
- AND att.create_date > #{cond.begin}
- </if>
- <if test="cond.end != null">
- AND att.create_date < #{cond.end}
- </if>
- </where>
- </select>
- <select id="findByIdWithInfo" resultMap="BaseResultMap" parameterType="cn.com.ty.lift.enterprise.oa.dto.AttendanceRequest">
- SELECT
- att.*,
- ui.name AS username
- FROM attendance att
- LEFT JOIN user_info ui ON att.user_id = ui.user_id
- <where>
- <if test="cond.id != null and cond.id > 0">
- AND att.id LIKE #{cond.id}
- </if>
- </where>
- </select>
- </mapper>
|