123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- <?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.ruoyi.project.plant.mapper.TStaffmgrMapper">
- <resultMap type="TStaffmgr" id="TStaffmgrResult">
- <result property="id" column="id" />
- <result property="plantCode" column="plant_code" />
- <result property="staffid" column="staffid" />
- <result property="name" column="name" />
- <result property="sex" column="sex" />
- <result property="birthday" column="birthday" />
- <result property="unit" column="unit" />
- <result property="team" column="team" />
- <result property="actualpost" column="actualpost" />
- <result property="contact" column="contact" />
- <result property="delFlag" column="del_flag" />
- <result property="createrCode" column="creater_code" />
- <result property="createdate" column="createdate" />
- <result property="updaterCode" column="updater_code" />
- <result property="updatedate" column="updatedate" />
- <result property="deptId" column="dept_id" />
- <result property="remarks" column="remarks" />
- <result property="deptName" column="dept_name" />
- <result property="education" column="education" />
- <result property="enAbility" column="en_ability" />
- <result property="mail" column="mail" />
- <result property="skillScore" column="skill_score" />
- <result property="accidentNum" column="accident_num" />
- <result property="photo" column="photo" />
- <result property="pId" column="p_id" />
- <result property="specialDuty" column="special_duty" />
- </resultMap>
- <sql id="selectTStaffmgrVo">
- select d.id, d.plant_code, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score, d.p_id , d.special_duty, s.dept_name from t_staffmgr d
- left join sys_dept s on s.dept_id = d.dept_id
- </sql>
- <select id="selectTStaffmgrList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
- <include refid="selectTStaffmgrVo"/>
- Left join SYS_DICT_DATA s0 on d.UNIT = s0.DICT_VALUE and s0.DICT_TYPE ='STAFF_UNIT'
- LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
- LEFT JOIN SYS_DICT_DATA s1 on d.team = s1.DICT_VALUE and s1.DICT_TYPE = 'TEAM_DIVIDE'
- <where>
- <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
- <if test="sex != null and sex != ''"> and sex = #{sex}</if>
- <if test="unit != null and unit != ''"> and unit = #{unit}</if>
- <if test="specialDuty != null and specialDuty != ''"> and special_duty like concat(concat('%', #{specialDuty}), '%')</if>
- <if test="units != null and units != ''">
- and
- unit in
- <foreach collection="units.split(',')" item="item" index="index"
- open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="team != null and team != ''"> and team = #{team}</if>
- <if test="teams != null and teams != ''">
- and
- team in
- <foreach collection="teams.split(',')" item="item" index="index"
- open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="actualpost != null and actualpost != ''"> and actualpost = #{actualpost}</if>
- <if test="actualposts != null and actualposts != ''">
- and
- actualpost in
- <foreach collection="actualposts.split(',')" item="item" index="index"
- open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="education != null and education != ''"> and education = #{education}</if>
- <if test="educations != null and educations != ''">
- and
- education in
- <foreach collection="educations.split(',')" item="item" index="index"
- open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="enAbility != null and enAbility != ''"> and en_ability = #{enAbility}</if>
- <if test="enAbilitys != null and enAbilitys != ''">
- and
- en_ability in
- <foreach collection="enAbilitys.split(',')" item="item" index="index"
- open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="haveEmail != null and haveEmail != ''"> and mail IS NOT NULL</if>
- <if test="skillevaluation != null"> and team = 10
- or team = 12
- or team = 14
- or team = 16
- </if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- ORDER BY s0.DICT_SORT, s1.DICT_SORT ,s.DICT_SORT
- </select>
- <select id="selectRecordList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
- <include refid="selectTStaffmgrVo"/>
- LEFT JOIN SYS_DICT_DATA s on d.ACTUALPOST = s.DICT_VALUE and s.DICT_TYPE = 'ACTUALPOST'
- <where>
- <if test="units != null and units != ''">
- and
- unit in
- <foreach collection="units.split(',')" item="item" index="index"
- open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- ORDER BY s.DICT_SORT, d.id
- </select>
- <select id="selectList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
- <include refid="selectTStaffmgrVo"/>
- <where>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- </select>
- <select id="selectLeftTStaffmgrList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
- <include refid="selectTStaffmgrVo"/>
- <where>
- and d.del_flag = 9
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- </select>
- <select id="selectTStaffmgrById" parameterType="Long" resultMap="TStaffmgrResult">
- <include refid="selectTStaffmgrVo"/>
- where id = #{id}
- </select>
- <select id="selectTStaffmgrByStaffId" parameterType="String" resultMap="TStaffmgrResult">
- <include refid="selectTStaffmgrVo"/>
- where staffid = #{staffid}
- </select>
- <insert id="insertTStaffmgr" parameterType="TStaffmgr" useGeneratedKeys="true" keyProperty="id">
- <selectKey keyProperty="id" resultType="long" order="BEFORE">
- SELECT seq_t_staffmgr.NEXTVAL as id FROM DUAL
- </selectKey>
- insert into t_staffmgr
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="plantCode != null and plantCode != ''">plant_code,</if>
- <if test="staffid != null and staffid != ''">staffid,</if>
- <if test="name != null and name != ''">name,</if>
- <if test="sex != null and sex != ''">sex,</if>
- <if test="birthday != null">birthday,</if>
- <if test="unit != null">unit,</if>
- <if test="team != null">team,</if>
- <if test="actualpost != null">actualpost,</if>
- <if test="contact != null">contact,</if>
- <if test="education != null">education,</if>
- <if test="enAbility != null">en_ability,</if>
- <if test="mail != null">mail,</if>
- <if test="accidentNum != null">accident_num,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createrCode != null">creater_code,</if>
- <if test="createdate != null">createdate,</if>
- <if test="updaterCode != null">updater_code,</if>
- <if test="updatedate != null">updatedate,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="remarks != null">remarks,</if>
- <if test="skillScore != null">skill_score,</if>
- <if test="photo != null">photo,</if>
- <if test="pId != null">p_id,</if>
- <if test="specialDuty != null">special_duty,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="plantCode != null and plantCode != ''">#{plantCode},</if>
- <if test="staffid != null and staffid != ''">#{staffid},</if>
- <if test="name != null and name != ''">#{name},</if>
- <if test="sex != null and sex != ''">#{sex},</if>
- <if test="birthday != null">#{birthday},</if>
- <if test="unit != null">#{unit},</if>
- <if test="team != null">#{team},</if>
- <if test="actualpost != null">#{actualpost},</if>
- <if test="contact != null">#{contact},</if>
- <if test="education != null">#{education},</if>
- <if test="enAbility != null">#{enAbility},</if>
- <if test="mail != null">#{mail},</if>
- <if test="accidentNum != null">#{accidentNum},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createrCode != null">#{createrCode},</if>
- <if test="createdate != null">#{createdate},</if>
- <if test="updaterCode != null">#{updaterCode},</if>
- <if test="updatedate != null">#{updatedate},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="remarks != null">#{remarks},</if>
- <if test="skillScore != null">#{skillScore},</if>
- <if test="photo != null">#{photo},</if>
- <if test="pId != null">#{pId},</if>
- <if test="specialDuty != null">#{specialDuty},</if>
- </trim>
- </insert>
- <update id="updateTStaffmgr" parameterType="TStaffmgr">
- update t_staffmgr
- <trim prefix="SET" suffixOverrides=",">
- <if test="plantCode != null and plantCode != ''">plant_code = #{plantCode},</if>
- <if test="staffid != null and staffid != ''">staffid = #{staffid},</if>
- <if test="name != null and name != ''">name = #{name},</if>
- <if test="sex != null and sex != ''">sex = #{sex},</if>
- <if test="birthday != null">birthday = #{birthday},</if>
- <if test="unit != null">unit = #{unit},</if>
- <if test="team != null">team = #{team},</if>
- <if test="actualpost != null">actualpost = #{actualpost},</if>
- <if test="contact != null">contact = #{contact},</if>
- <if test="education != null">education = #{education},</if>
- <if test="enAbility != null">en_ability = #{enAbility},</if>
- <if test="accidentNum != null">accident_num = #{accidentNum},</if>
- <if test="mail != null">mail = #{mail},</if>
- <if test="skillScore != null">skill_score = #{skillScore},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createrCode != null">creater_code = #{createrCode},</if>
- <if test="createdate != null">createdate = #{createdate},</if>
- <if test="updaterCode != null">updater_code = #{updaterCode},</if>
- <if test="updatedate != null">updatedate = #{updatedate},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="remarks != null">remarks = #{remarks},</if>
- <if test="photo != null">photo = #{photo},</if>
- <if test="pId != null">p_id = #{pId},</if>
- <if test="specialDuty != null">special_duty = #{specialDuty},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="deleteTStaffmgrById" parameterType="Long">
- update t_staffmgr set del_flag = 2 where id = #{id}
- </update>
- <update id="deleteLeftTStaffmgrByIds" parameterType="Long">
- update t_staffmgr set del_flag = 9 where id = #{id}
- </update>
- <update id="reLeftTStaffmgrByIds" parameterType="Long">
- update t_staffmgr set del_flag = 0 where id = #{id}
- </update>
- <update id="deleteTStaffmgrByIds" parameterType="String">
- update t_staffmgr set del_flag = 2 where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <select id="selectEduData" resultType="com.ruoyi.project.common.domain.DataEntity">
- SELECT count(1) as dataNum,d.EDUCATION as dataName FROM "T_STAFFMGR" d
- <where>
- <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
- <if test="sex != null and sex != ''"> and sex = #{sex}</if>
- <if test="unit != null and unit != ''"> and unit = #{unit}</if>
- <if test="team != null and team != ''"> and team = #{team}</if>
- <if test="actualpost != null and actualpost != ''"> and actualpost = #{actualpost}</if>
- <if test="education != null and education != ''"> and education = #{education}</if>
- <if test="enAbility != null and enAbility != ''"> and en_ability = #{enAbility}</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- GROUP BY EDUCATION
- order by dataName
- </select>
- <select id="selectEngData" resultType="com.ruoyi.project.common.domain.DataEntity">
- SELECT count(1) as dataNum,d.en_ability as dataName FROM "T_STAFFMGR" d
- <where>
- <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
- <if test="sex != null and sex != ''"> and sex = #{sex}</if>
- <if test="unit != null and unit != ''"> and unit = #{unit}</if>
- <if test="team != null and team != ''"> and team = #{team}</if>
- <if test="actualpost != null and actualpost != ''"> and actualpost = #{actualpost}</if>
- <if test="education != null and education != ''"> and education = #{education}</if>
- <if test="enAbility != null and enAbility != ''"> and en_ability = #{enAbility}</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- GROUP BY en_ability
- order by dataName
- </select>
- <select id="selectTeamData" resultType="com.ruoyi.project.common.domain.DataEntity">
- SELECT count(1) as dataNum,d.team as dataName FROM "T_STAFFMGR" d
- <where>
- <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
- <if test="sex != null and sex != ''"> and sex = #{sex}</if>
- <if test="unit != null and unit != ''"> and unit = #{unit}</if>
- <if test="team != null and team != ''"> and team = #{team}</if>
- <if test="actualpost != null and actualpost != ''"> and actualpost = #{actualpost}</if>
- <if test="education != null and education != ''"> and education = #{education}</if>
- <if test="enAbility != null and enAbility != ''"> and en_ability = #{enAbility}</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- GROUP BY team
- order by dataName
- </select>
- </mapper>
|