// 1:根据职位进行模糊查询+附加条件
List<PositionPageBean>queryAllPosition(Map<String,Object> map);// mapper.xml的sql配置<!--sql块--><sql id="allPosition">
team_name,company.company_user_id,company_name,company_field,company_curr,company_scale,
position_name,position_city,position_money,position_experience,position_education,position_walfare
</sql><select id="queryAllPosition" resultType="com.weicai.dao.domain.PositionPageBean" parameterType="hashmap">
SELECT DISTINCT <include refid="allPosition"/>
FROM weicai_company company,weicai_position position,weicai_team team
WHERE company.company_user_id = team.company_user_id
and company.id = position.position_company_id
and position.position_name like #{
search_input}<where><if test="salary_range!=null">
and position.position_money=#{
salary_range}</if><if test="work_experience!=null">
and position.position_experience=#{
work_experience}</if><if test="minimum_education!=null">
and position.position_education=#{
minimum_education}</if><if test="work_type!=null">
and position.position_nature=#{
work_type}</if><if test="develop_Time!=null">
and str_to_date(position.position_time,'%Y-%m-%d %H:%i:%s')>date_add(now(),
interval #{
develop_Time} day)</if><if test="work_city!=null and work_city!='全国'">
and position.position_city=#{
work_city}</if></where></select>
// 2:模糊查询公司
List<PositionPageBean>queryAllCompany(Map<String,Object> map);// mapper.xml的配置<select id="queryAllCompany" resultType="com.weicai.dao.domain.PositionPageBean" parameterType="hashmap">
SELECT DISTINCT <include refid="allPosition"/>
FROM weicai_company company,weicai_position position,weicai_team team
<where>
company.company_user_id = team.company_user_id
and company.id = position.position_company_id
and company.company_name
like #{
search_input}<if test="salary_range!=null">
and position.position_money=#{
salary_range}</if><if test="work_experience!=null">
and position.position_experience=#{
work_experience}</if><if test="minimum_education!=null">
and position.position_education=#{
minimum_education}</if><if test="work_type!=null">
and position.position_nature=#{
work_type}</if><if test="develop_Time!=null">
and str_to_date(position.position_time,'%Y-%m-%d %H:%i:%s')>date_add(now(),
interval #{
develop_Time} day)</if><if test="work_city!=null and work_city!='全国'">
and position.position_city=#{
work_city}</if></where></select>