103 lines
4.1 KiB
XML
103 lines
4.1 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.bonus.gzrn.rnbmw.basic.dao.SuperTeamListDao">
|
||
|
|
|
||
|
|
<insert id="addSuperTeam">
|
||
|
|
INSERT INTO `bm_outstanding_team`(`company_id`, `team_name`, `team_type`,
|
||
|
|
`foreman_name`, `foreman_idnumber`, `foreman_phone`, `sub_name`, `pro_name`,
|
||
|
|
`fraction`, `remark`, `IS_ACTIVE`)
|
||
|
|
VALUES (#{companyId}, #{teamName}, #{teamType}, #{foremanName}, #{foremanIdNumber},
|
||
|
|
#{foremanPhone}, #{subName}, #{proName}, #{fraction}, #{remark}, '1')
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateSuperTeam">
|
||
|
|
UPDATE `bm_outstanding_team` SET
|
||
|
|
`team_name` = #{teamName},
|
||
|
|
`team_type` = #{teamType}, `foreman_name` = #{foremanName},
|
||
|
|
`foreman_idnumber` = #{foremanIdNumber},
|
||
|
|
`foreman_phone` = #{foremanPhone}, `sub_name` = #{subName},
|
||
|
|
`pro_name` = #{proName}, `fraction` = #{fraction}, `remark` = #{remark}
|
||
|
|
WHERE `id` = #{id}
|
||
|
|
</update>
|
||
|
|
<delete id="delSuperTeamById">
|
||
|
|
UPDATE `bm_outstanding_team` SET is_active = '0' where id = #{id}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<select id="getSuperTeamListCount" resultType="java.lang.Integer">
|
||
|
|
SELECT
|
||
|
|
count(1)
|
||
|
|
FROM
|
||
|
|
`bm_outstanding_team` bot
|
||
|
|
WHERE bot.IS_ACTIVE = '1'
|
||
|
|
<if test="params != null and params != ''">
|
||
|
|
<if test="params.companyId != null and params.companyId != ''">
|
||
|
|
AND bot.company_id = #{params.companyId}
|
||
|
|
</if>
|
||
|
|
<if test="params.keyWord != null and params.keyWord != ''">
|
||
|
|
AND (
|
||
|
|
bot.team_name LIKE concat ('%',#{params.keyWord},'%')
|
||
|
|
or bot.team_type LIKE concat ('%',#{params.keyWord},'%')
|
||
|
|
or bot.sub_name LIKE concat ('%',#{params.keyWord},'%')
|
||
|
|
or bot.pro_name LIKE concat ('%',#{params.keyWord},'%')
|
||
|
|
or bot.foreman_name LIKE concat ('%',#{params.keyWord},'%')
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getSuperTeamList" resultType="com.bonus.gzrn.rnbmw.basic.entity.OutstandingTeamBean">
|
||
|
|
SELECT
|
||
|
|
bot.id,
|
||
|
|
bot.team_name as teamName,
|
||
|
|
bot.team_type as teamType,
|
||
|
|
bot.foreman_name as foremanName,
|
||
|
|
bot.foreman_idnumber as foremanIdNumber,
|
||
|
|
bot.foreman_phone as foremanPhone,
|
||
|
|
bot. sub_name as subName,
|
||
|
|
bot.pro_name as proName,
|
||
|
|
bot.fraction,
|
||
|
|
bot.remark
|
||
|
|
FROM
|
||
|
|
`bm_outstanding_team` bot
|
||
|
|
WHERE bot.IS_ACTIVE = '1'
|
||
|
|
<if test="params != null and params != ''">
|
||
|
|
<if test="params.companyId != null and params.companyId != ''">
|
||
|
|
AND bot.company_id = #{params.companyId}
|
||
|
|
</if>
|
||
|
|
<if test="params.keyWord != null and params.keyWord != ''">
|
||
|
|
AND (
|
||
|
|
bot.team_name LIKE concat ('%',#{params.keyWord},'%')
|
||
|
|
or bot.team_type LIKE concat ('%',#{params.keyWord},'%')
|
||
|
|
or bot.sub_name LIKE concat ('%',#{params.keyWord},'%')
|
||
|
|
or bot.pro_name LIKE concat ('%',#{params.keyWord},'%')
|
||
|
|
or bot.foreman_name LIKE concat ('%',#{params.keyWord},'%')
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
</if>
|
||
|
|
ORDER BY bot.fraction DESC
|
||
|
|
limit #{offset}, #{limit}
|
||
|
|
</select>
|
||
|
|
<select id="isExistNumber" resultType="java.lang.Integer">
|
||
|
|
select count(1) from bm_outstanding_team where foreman_idnumber = #{foremanIdNumber} and is_active = '1'
|
||
|
|
</select>
|
||
|
|
<select id="getSuperTeamById" resultType="com.bonus.gzrn.rnbmw.basic.entity.OutstandingTeamBean">
|
||
|
|
SELECT
|
||
|
|
bot.id,
|
||
|
|
bot.team_name as teamName,
|
||
|
|
bot.team_type as teamType,
|
||
|
|
bot.foreman_name as foremanName,
|
||
|
|
bot.foreman_idnumber as foremanIdNumber,
|
||
|
|
bot.foreman_phone as foremanPhone,
|
||
|
|
bot. sub_name as subName,
|
||
|
|
bot.pro_name as proName,
|
||
|
|
bot.fraction,
|
||
|
|
bot.remark
|
||
|
|
FROM
|
||
|
|
`bm_outstanding_team` bot
|
||
|
|
WHERE bot.id = #{id}
|
||
|
|
and bot.IS_ACTIVE = '1'
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|