61 lines
2.6 KiB
XML
61 lines
2.6 KiB
XML
<?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.dao.YuangongDao">
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="Base_Column_List">
|
|
a.id as id
|
|
,a.username as username
|
|
,a.password as password
|
|
,a.yuangong_name as yuangongName
|
|
,a.sex_types as sexTypes
|
|
,a.yuangong_phone as yuangongPhone
|
|
,a.yuangong_delete as yuangongDelete
|
|
,a.create_time as createTime
|
|
</sql>
|
|
<select id="selectListView" parameterType="map" resultType="com.entity.view.YuangongView" >
|
|
SELECT
|
|
<include refid="Base_Column_List" />
|
|
|
|
-- 级联表的字段
|
|
|
|
FROM yuangong a
|
|
|
|
<where>
|
|
<if test="params.ids != null">
|
|
and a.id in
|
|
<foreach item="item" index="index" collection="params.ids" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
<if test=" params.username != '' and params.username != null and params.username != 'null' ">
|
|
and a.username like CONCAT('%',#{params.username},'%')
|
|
</if>
|
|
<if test=" params.password != '' and params.password != null and params.password != 'null' ">
|
|
and a.password like CONCAT('%',#{params.password},'%')
|
|
</if>
|
|
<if test=" params.yuangongName != '' and params.yuangongName != null and params.yuangongName != 'null' ">
|
|
and a.yuangong_name like CONCAT('%',#{params.yuangongName},'%')
|
|
</if>
|
|
<if test="params.sexTypes != null and params.sexTypes != ''">
|
|
and a.sex_types = #{params.sexTypes}
|
|
</if>
|
|
<if test=" params.yuangongPhone != '' and params.yuangongPhone != null and params.yuangongPhone != 'null' ">
|
|
and a.yuangong_phone like CONCAT('%',#{params.yuangongPhone},'%')
|
|
</if>
|
|
<if test="params.yuangongDeleteStart != null and params.yuangongDeleteStart != ''">
|
|
<![CDATA[ and a.yuangong_delete >= #{params.yuangongDeleteStart} ]]>
|
|
</if>
|
|
<if test="params.yuangongDeleteEnd != null and params.yuangongDeleteEnd != ''">
|
|
<![CDATA[ and a.yuangong_delete <= #{params.yuangongDeleteEnd} ]]>
|
|
</if>
|
|
<if test="params.yuangongDelete != null and params.yuangongDelete != ''">
|
|
and a.yuangong_delete = #{params.yuangongDelete}
|
|
</if>
|
|
|
|
</where>
|
|
|
|
order by a.${params.orderBy} desc
|
|
</select>
|
|
|
|
</mapper> |