<?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.stylefeng.guns.modular.system.dao.RecruitMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Recruit">
|
<id column="id" property="id"/>
|
<result column="driverType" property="driverType"/>
|
<result column="title" property="title"/>
|
<result column="companyType" property="companyType"/>
|
<result column="companyId" property="companyId"/>
|
<result column="contactsName" property="contactsName"/>
|
<result column="provinceCode" property="provinceCode"/>
|
<result column="cityCode" property="cityCode"/>
|
<result column="provinceName" property="provinceName"/>
|
<result column="cityName" property="cityName"/>
|
<result column="addres" property="addres"/>
|
<result column="contactsPhone" property="contactsPhone"/>
|
<result column="describe" property="describe"/>
|
<result column="recruitsNumber" property="recruitsNumber"/>
|
<result column="experienceRequirements" property="experienceRequirements"/>
|
<result column="educationalRequirements" property="educationalRequirements"/>
|
<result column="welfare" property="welfare"/>
|
<result column="startSalary" property="startSalary"/>
|
<result column="endSalary" property="endSalary"/>
|
<result column="interviewOrNot" property="interviewOrNot"/>
|
<result column="status" property="status"/>
|
<result column="firstPageShow" property="firstPageShow"/>
|
<result column="createTime" property="createTime"/>
|
<result column="insertUser" property="insertUser"/>
|
</resultMap>
|
|
|
<select id="list" resultType="map">
|
select
|
a.id,
|
DATE_FORMAT(a.createTime, '%Y/%m/%d %H:%i') as createTime,
|
b.`name` as insertUser,
|
a.title,
|
a.`describe`,
|
a.recruitsNumber,
|
a.experienceRequirements,
|
a.educationalRequirements,
|
a.welfare,
|
a.interviewOrNot,
|
CONCAT(a.startSalary, ' - ', a.endSalary) as salary,
|
a.firstPageShow,
|
a.`status`
|
from tb_recruit a
|
left join sys_user b on (a.insertUser = b.id)
|
where a.`status` != 6
|
<if test="null != companyId">
|
and a.companyId = #{companyId}
|
</if>
|
<if test="null != start and '' != start and null != end and '' != end">
|
and DATE_FORMAT(a.createTime, '%Y-%m-%d') between #{start} and #{end}
|
</if>
|
<if test="null != title and '' != title">
|
and a.title like CONCAT('%', #{title}, '%')
|
</if>
|
<if test="null != experienceRequirements and '' != experienceRequirements">
|
and a.experienceRequirements like CONCAT('%', #{experienceRequirements}, '%')
|
</if>
|
<if test="null != insertUser and '' != insertUser">
|
and b.`name` like CONCAT('%', #{insertUser}, '%')
|
</if>
|
<if test="null != driverType and '' != driverType">
|
and a.driverType like CONCAT('%', #{driverType}, '%')
|
</if>
|
order by a.createTime desc
|
<if test="null != offset and null != limit">
|
limit #{offset}, #{limit}
|
</if>
|
</select>
|
|
|
<select id="listCount" resultType="int">
|
select
|
count(1)
|
from tb_recruit a
|
left join sys_user b on (a.insertUser = b.id)
|
where a.`status` != 6
|
<if test="null != companyId">
|
and a.companyId = #{companyId}
|
</if>
|
<if test="null != start and '' != start and null != end and '' != end">
|
and DATE_FORMAT(a.createTime, '%Y-%m-%d') between #{start} and #{end}
|
</if>
|
<if test="null != title and '' != title">
|
and a.title like CONCAT('%', #{title}, '%')
|
</if>
|
<if test="null != experienceRequirements and '' != experienceRequirements">
|
and a.experienceRequirements like CONCAT('%', #{experienceRequirements}, '%')
|
</if>
|
<if test="null != insertUser and '' != insertUser">
|
and b.`name` like CONCAT('%', #{insertUser}, '%')
|
</if>
|
<if test="null != driverType and '' != driverType">
|
and a.driverType like CONCAT('%', #{driverType}, '%')
|
</if>
|
</select>
|
</mapper>
|