UserSwitchMapper.xml 2.04 KB
<?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.glsx.dj.system.mapper.UserSwitchMapper" >
  <resultMap id="BaseResultMap" type="cn.com.glsx.dj.system.model.UserSwitch" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="user_id" property="userId" jdbcType="INTEGER" />
    <result column="switch_group" property="switchGroup" jdbcType="SMALLINT" />
    <result column="switch_type" property="switchType" jdbcType="SMALLINT" />
    <result column="status" property="status" jdbcType="TINYINT" />
    <result column="created_by" property="createdBy" jdbcType="VARCHAR" />
    <result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
    <result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
    <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
    <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
  </resultMap>
  <resultMap id="DTOResultMap" type="cn.com.glsx.dj.system.dto.UserSwitchDTO" extends="BaseResultMap">
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    id, user_id, switch_group, switch_type, status, created_by, created_date, updated_by, 
    updated_date, deleted_flag
  </sql>
  
  <select id="list" parameterType="cn.com.glsx.dj.system.dto.UserSwitchDTO" resultMap="DTOResultMap">
  	select <include refid="Base_Column_List"/> from dj_system_user_switch
  	<where>
  		deleted_flag = 'N'
  		<if test="userId != null">
  			and user_id = #{userId}
  		</if>
  		<if test="switchGroup != null">
  			and switch_group = #{switchGroup}
  		</if>
  		<if test="switchType != null">
  			and switch_type = #{switchType}
  		</if>
  		<if test="status != null">
  			and status = #{status}
  		</if>
  		<if test="endDate != null">
  			and updated_date <![CDATA[ <= ]]> #{endDate}
  		</if>
  	</where>
  	order by id asc
  </select>
</mapper>