jl-jjsp-service/securityControl-modules/securityControl-proteam/target/classes/mapper/dutyTask/CollectiveEnterpriseMapper.xml

54 lines
2.2 KiB
XML
Raw Permalink Normal View History

2025-09-24 11:10:04 +08:00
<?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.sercurityControl.proteam.dutyTask.mapper.CollectiveEnterpriseMapper">
<insert id="add">
INSERT INTO jj_enterprise_unit(enterprise_id,unit_id) VALUES
(
#{enterpriseId},#{unitId}
)
</insert>
<insert id="addCollectiveEnterprise">
INSERT INTO jj_collective_enterprise(unit_name,delete_flag) VALUES
(
#{enterpriseName},'0'
)
</insert>
<update id="update">
update jj_enterprise_unit set enterprise_id = #{enterpriseId} where unit_id = #{unitId}
</update>
<update id="updateCollectiveEnterprise">
update jj_collective_enterprise set unit_name = #{enterpriseName} where id = #{enterpriseId}
</update>
<delete id="delCollectiveEnterpriseList">
update jj_collective_enterprise set delete_flag = '1' where id = #{enterpriseId}
</delete>
<delete id="delEnterpriseUnit">
delete from jj_enterprise_unit where enterprise_id = #{enterpriseId}
</delete>
<select id="getData" resultType="java.lang.String">
SELECT
ANY_VALUE(GROUP_CONCAT(jeu.unit_id SEPARATOR ',')) AS unitIds
FROM
jj_enterprise_unit jeu
WHERE
jeu.enterprise_id = #{enterpriseId}
GROUP BY
jeu.enterprise_id;
</select>
<select id="getCollectiveEnterpriseByUnitId"
resultType="com.sercurityControl.proteam.dutyTask.domain.CollectiveEnterpriseVo">
select jeu.enterprise_id as enterpriseId,jeu.unit_id as unitId
from jj_enterprise_unit jeu
where jeu.unit_id = #{unitId}
</select>
<select id="getCollectiveEnterpriseList"
resultType="com.sercurityControl.proteam.dutyTask.domain.CollectiveEnterpriseVo">
select id as enterpriseId,unit_name as enterpriseName from jj_collective_enterprise where delete_flag = 0
<if test="enterpriseName!=null and enterpriseName.trim()!=''">
and unit_name = #{enterpriseName}
</if>
</select>
</mapper>