123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?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.platform.dao.mapper.sbUnused.SbUnusedMapper">
- <sql id="Base_Column_List">
- unused.id,
- unused.name,
- unused.apply_time,
- unused.apply_user_id,
- unused.status,
- unused.created_user_id,
- unused.created_time,
- unused.update_user_id,
- unused.verity_user_id
- </sql>
- <sql id="Ref_Column_List">
- unused.name,
- unused.apply_time,
- unused.apply_user_id,
- unused.status,
- unused.verity_user_id
- </sql>
- <sql id="List_Condition">
- <if test="id != null and id != ''">
- and unused.id = #{id}
- </if>
- <if test="name != null and name != ''">
- and unused.name = #{name}
- </if>
- <if test="applyTimeStart != null">
- and unused.apply_time <![CDATA[>=]]>; #{applyTimeStart}
- </if>
- <if test="applyTimeEnd != null">
- and unused.apply_time <![CDATA[<=]]> #{applyTimeEnd}
- </if>
- <if test="applyTime != null">
- and unused.apply_time = #{applyTime}
- </if>
- <if test="applyUserId != null and applyUserId != ''">
- and unused.apply_user_id = #{applyUserId}
- </if>
- <if test="status != null">
- and unused.status = #{status}
- </if>
- <if test="createdUserId != null and createdUserId != ''">
- and unused.created_user_id = #{createdUserId}
- </if>
- <if test="createdTimeStart != null">
- and unused.created_time <![CDATA[>=]]>; #{createdTimeStart}
- </if>
- <if test="createdTimeEnd != null">
- and unused.created_time <![CDATA[<=]]> #{createdTimeEnd}
- </if>
- <if test="createdTime != null">
- and unused.created_time = #{createdTime}
- </if>
- <if test="updateUserId != null and updateUserId != ''">
- and unused.update_user_id = #{updateUserId}
- </if>
- <if test="verityUserId != null and verityUserId != ''">
- and unused.verity_user_id = #{verityUserId}
- </if>
- <if test="keyword != null and keyword != ''">
- and unused.name like concat(concat('%',#{keyword}),'%')
- </if>
- <if test="allUserId!=null">
- and (unused.verity_user_id=#{allUserId}
- or unused.verity_user_id2=#{allUserId}
- )
- </if>
- <if test="statusList!=null and statusList.size()>0">
- and unused.status in
- <foreach collection="statusList" separator="," close=")" open="(" item="item">
- #{item}
- </foreach>
- </if>
- <if test="hFlag!=null and hFlag == 1">
- and unused.status!=1
- </if>
- </sql>
- <select id="selectList" parameterType="com.platform.dao.dto.sbUnused.SbUnusedDTO" resultType="com.platform.dao.vo.query.sbUnused.SbUnusedVO">
- select unused.*,user.real_name as applyName,user2.real_name as verifyUserName,user3.real_name as verifyUserName2
- from t_sb_unused as unused left join t_sys_user user on user.user_id = unused.apply_user_id
- left join t_sys_user user2 on user2.user_id = unused.verity_user_id
- left join t_sys_user user3 on user3.user_id = unused.verity_user_id2
- <where>
- <include refid="List_Condition" />
- </where>
- </select>
- <select id="getUnusedVO" parameterType="java.lang.String"
- resultType="com.platform.dao.vo.query.sbUnused.SbUnusedVO">
- select unused.*,user.real_name as applyName,user2.real_name as verifyUserName,
- user3.real_name as verifyUserName2
- from t_sb_unused unused left join t_sys_user user
- on unused.apply_user_id = user.user_id
- left join t_sys_user user2 on user2.user_id = unused.verity_user_id
- left join t_sys_user user3 on user3.user_id = unused.verity_user_id2
- where id = #{id}
- </select>
- <select id="getSbUnusedCount" resultType="com.platform.dao.vo.SbUnusedCount"
- parameterType="com.platform.dao.dto.sbUnused.SbUnusedDTO">
- select count(1) as num,unused.status from t_sb_unused unused
- where 1=1
- <if test="allUserId!=null and allUserId!=''">
- and (unused.apply_user_id = #{allUserId} or
- unused.verity_user_id = #{allUserId} or
- unused.verity_user_id2 = #{allUserId}
- )
- </if>
- group by unused.status
- </select>
- </mapper>
|