| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?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.store.StoreMapper">
- <sql id="Base_Column_List">
- store.id,
- store.level,
- store.no,
- store.use_company,
- store.use_project,
- store.user_id,
- store.name,
- store.type,
- store.sort,
- store.del_flag,
- store.parent_id,
- store.remark,
- store.created_user_id,
- store.created_user_name,
- store.update_user_id,
- store.update_user_name,
- store.created_time,
- store.update_time
- </sql>
- <sql id="Ref_Column_List">
- store.no,
- store.level,
- store.use_company,
- store.use_project,
- store.user_id,
- store.name,
- store.type,
- store.sort,
- store.del_flag,
- store.parent_id,
- store.remark
- </sql>
- <sql id="List_Condition">
- <if test="id != null and id != ''">
- and store.id = #{id}
- </if>
- <if test="level != null and level != ''">
- and store.level = #{level}
- </if>
- <if test="levelList != null and levelList.size > 0">
- AND store.level in
- <foreach item="item" index="index" collection="levelList" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="no != null and no != ''">
- and store.no = #{no}
- </if>
- <if test="useCompany != null and useCompany != ''">
- and store.use_company = #{useCompany}
- </if>
- <if test="useProject != null and useProject != ''">
- and store.use_project = #{useProject}
- </if>
- <if test="userId != null and userId != ''">
- and store.user_id = #{userId}
- </if>
- <if test="name != null and name != ''">
- and store.name = #{name}
- </if>
- <if test="type != null">
- and store.type = #{type}
- </if>
- <if test="sort != null">
- and store.sort = #{sort}
- </if>
- <if test="delFlag != null">
- and store.del_flag = #{delFlag}
- </if>
- <if test="parentId != null and parentId != ''">
- and store.parent_id = #{parentId}
- </if>
- <if test="remark != null and remark != ''">
- and store.remark = #{remark}
- </if>
- <if test="createdUserId != null and createdUserId != ''">
- and store.created_user_id = #{createdUserId}
- </if>
- <if test="createdUserName != null and createdUserName != ''">
- and store.created_user_name = #{createdUserName}
- </if>
- <if test="updateUserId != null and updateUserId != ''">
- and store.update_user_id = #{updateUserId}
- </if>
- <if test="updateUserName != null and updateUserName != ''">
- and store.update_user_name = #{updateUserName}
- </if>
- <if test="createdTimeStart != null">
- and store.created_time <![CDATA[>=]]>; #{createdTimeStart}
- </if>
- <if test="createdTimeEnd != null">
- and store.created_time <![CDATA[<=]]> #{createdTimeEnd}
- </if>
- <if test="createdTime != null">
- and store.created_time = #{createdTime}
- </if>
- <if test="updateTimeStart != null">
- and store.update_time <![CDATA[>=]]>; #{updateTimeStart}
- </if>
- <if test="updateTimeEnd != null">
- and store.update_time <![CDATA[<=]]> #{updateTimeEnd}
- </if>
- <if test="updateTime != null">
- and store.update_time = #{updateTime}
- </if>
- <if test="keyword != null and keyword != ''">
- and (store.name like concat('%',#{keyword},'%')
- or store.no like concat('%',#{keyword},'%'))
- </if>
- </sql>
- <select id="selectList" parameterType="com.platform.dao.dto.store.StoreDTO"
- resultType="com.platform.dao.vo.query.store.StoreVO">
- select store.*, pstore.name parentName, user.real_name as userName
- from t_store as store
- left join t_store pstore on store.parent_id = pstore.id
- left join t_sys_user user on store.user_id = user.user_id
- <where>
- <include refid="List_Condition"/>
- </where>
- order by store.sort asc
- </select>
- </mapper>
|