167 lines
8.7 KiB
XML
167 lines
8.7 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.yanzhu.jh.project.mapper.SurProjectStandardMapper">
|
|
|
|
<resultMap type="SurProjectStandard" id="SurProjectStandardResult">
|
|
<result property="id" column="id" />
|
|
<result property="projectId" column="project_id" />
|
|
<result property="deptId" column="dept_id" />
|
|
<result property="deptName" column="dept_name" />
|
|
<result property="imageFile" column="image_file" />
|
|
<result property="standardDesc" column="standard_desc" />
|
|
<result property="ord" column="ord" />
|
|
<result property="standardType" column="standard_type" />
|
|
<result property="standardTypeName" column="standard_type_name" />
|
|
<result property="standardTypeRemark" column="standard_type_remark" />
|
|
<result property="isDel" column="is_del" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectSurProjectStandardVo">
|
|
SELECT sps.id, sps.project_id, sps.dept_id, sd.dept_name, sps.image_file, sps.standard_desc, sps.ord, sps.standard_type,
|
|
sp.projectName remark,
|
|
sps.is_del, sps.create_by, sps.create_time, sps.update_by, sps.update_time
|
|
FROM sur_project_standard sps
|
|
LEFT JOIN sys_dept sd ON sd.dept_id = sps.dept_id
|
|
LEFT JOIN sur_project sp ON sp.id = sps.project_id
|
|
</sql>
|
|
|
|
<select id="selectSurProjectStandardList" parameterType="SurProjectStandard" resultMap="SurProjectStandardResult">
|
|
<include refid="selectSurProjectStandardVo"/>
|
|
<where>
|
|
<if test="projectId != null "> and sps.project_id = #{projectId}</if>
|
|
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
|
|
<if test="activeName != null and activeName != ''"> and sp.progressVisible = 0</if>
|
|
<if test="deptId != null "> and sps.dept_id = #{deptId}</if>
|
|
<if test="standardDesc != null and standardDesc != ''"> and sps.standard_desc like concat('%', #{standardDesc}, '%')</if>
|
|
<if test="standardType != null and standardType != ''"> and sps.standard_type like concat('', #{standardType}, '%')</if>
|
|
<if test="isDel != null "> and sps.is_del = #{isDel}</if>
|
|
</where>
|
|
order by sps.ord,sps.create_time desc
|
|
</select>
|
|
|
|
<select id="selectSurProjectStandardGroupByType" parameterType="SurProjectStandard" resultType="map">
|
|
select left(sps.standard_type,1) as standardType, count(1) as total from sur_project_standard sps
|
|
<where>
|
|
<if test="projectId != null "> and sps.project_id = #{projectId}</if>
|
|
<if test="deptId != null "> and sps.dept_id = #{deptId}</if>
|
|
<if test="standardDesc != null and standardDesc != ''"> and sps.standard_desc = #{standardDesc}</if>
|
|
<if test="isDel != null "> and sps.is_del = #{isDel}</if>
|
|
</where>
|
|
group by left(sps.standard_type,1)
|
|
</select>
|
|
|
|
<select id="selectSurProjectStandardById" parameterType="Long" resultMap="SurProjectStandardResult">
|
|
<include refid="selectSurProjectStandardVo"/>
|
|
where sps.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertSurProjectStandard" parameterType="SurProjectStandard" useGeneratedKeys="true" keyProperty="id">
|
|
insert into sur_project_standard
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="projectId != null">project_id,</if>
|
|
<if test="deptId != null">dept_id,</if>
|
|
<if test="imageFile != null">image_file,</if>
|
|
<if test="standardDesc != null">standard_desc,</if>
|
|
<if test="ord != null">ord,</if>
|
|
<if test="standardType != null">standard_type,</if>
|
|
<if test="isDel != null">is_del,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="projectId != null">#{projectId},</if>
|
|
<if test="deptId != null">#{deptId},</if>
|
|
<if test="imageFile != null">#{imageFile},</if>
|
|
<if test="standardDesc != null">#{standardDesc},</if>
|
|
<if test="ord != null">#{ord},</if>
|
|
<if test="standardType != null">#{standardType},</if>
|
|
<if test="isDel != null">#{isDel},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSurProjectStandard" parameterType="SurProjectStandard">
|
|
update sur_project_standard
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="projectId != null">project_id = #{projectId},</if>
|
|
<if test="deptId != null">dept_id = #{deptId},</if>
|
|
<if test="imageFile != null">image_file = #{imageFile},</if>
|
|
<if test="standardDesc != null">standard_desc = #{standardDesc},</if>
|
|
<if test="ord != null">ord = #{ord},</if>
|
|
<if test="standardType != null">standard_type = #{standardType},</if>
|
|
<if test="isDel != null">is_del = #{isDel},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteSurProjectStandardById" parameterType="Long">
|
|
delete from sur_project_standard where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteSurProjectStandardByIds" parameterType="String">
|
|
delete from sur_project_standard where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
<select id="groupByType" parameterType="SurProjectStandard" resultMap="com.ruoyi.system.mapper.SysDictDataMapper.SysDictDataResult">
|
|
select left(a.standard_type ,1) dict_label,count(1) STATUS
|
|
from sur_project_standard a ,sur_project sp
|
|
where a.is_del =0 and a.project_id=sp.id and sp.progressVisible=0
|
|
<if test="projectId!=null and projectId>0"> and a.project_id=#{projectId}</if>
|
|
<if test="deptId!=null and deptId>0">
|
|
and sp.deptid= #{deptId}
|
|
</if>
|
|
<if test="proType != null and proType != '' "> and sp.projectType = #{proType}</if>
|
|
<if test="prjIds !=null and prjIds.size()>0">
|
|
and a.project_id in
|
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
group by left(a.standard_type ,1)
|
|
order by left(a.standard_type ,1)
|
|
</select>
|
|
|
|
<select id="groupByProject" resultMap="SurProjectStandardResult">
|
|
select a.project_id,a.cnt dept_id,b.projectName standard_desc from (
|
|
select a.project_id,count(1) cnt
|
|
from sur_project_standard a where a.is_del=0
|
|
group by a.project_id )a,
|
|
sur_project b where a.project_id=b.id and b.progressVisible=0
|
|
order by a.cnt desc
|
|
</select>
|
|
|
|
<select id="selectList" parameterType="SurProjectStandard" resultMap="SurProjectStandardResult">
|
|
<include refid="selectSurProjectStandardVo"/>
|
|
where sps.is_del =0
|
|
<if test="projectId!=null and projectId>0"> and sps.project_id=#{projectId}</if>
|
|
<if test="deptId!=null and deptId>0">
|
|
and sp.deptId= #{deptId}
|
|
</if>
|
|
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
|
|
<if test="activeName != null and activeName != ''"> and sp.progressVisible = 0</if>
|
|
<if test="prjIds !=null and prjIds.size()>0">
|
|
and sps.project_id in
|
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
<if test="standardType!=null and standardType>0"> and sps.standard_type=#{standardType}</if>
|
|
</select>
|
|
</mapper> |