|
@@ -1,29 +1,29 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.system.mapper.project.BmProjectMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="BmProject" id="BmProjectResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="name" column="name" />
|
|
|
- <result property="industryCategory" column="industry_category" />
|
|
|
- <result property="industry" column="industry" />
|
|
|
- <result property="isBackbussiness" column="is_backbussiness" />
|
|
|
- <result property="projectStatus" column="project_status" />
|
|
|
- <result property="deptId" column="dept_id" />
|
|
|
- <result property="totAmt" column="tot_amt" />
|
|
|
- <result property="isDel" column="is_del" />
|
|
|
- <result property="orderBeginTime" column="order_begin_time" />
|
|
|
- <result property="orderEndTime" column="order_end_time" />
|
|
|
- <result property="remark" column="remark" />
|
|
|
- <result property="deptName" column="dept_name" />
|
|
|
- <result property="dictLabel" column="dict_label" />
|
|
|
- <result property="num" column="num" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="name" column="name"/>
|
|
|
+ <result property="industryCategory" column="industry_category"/>
|
|
|
+ <result property="industry" column="industry"/>
|
|
|
+ <result property="isBackbussiness" column="is_backbussiness"/>
|
|
|
+ <result property="projectStatus" column="project_status"/>
|
|
|
+ <result property="deptId" column="dept_id"/>
|
|
|
+ <result property="totAmt" column="tot_amt"/>
|
|
|
+ <result property="isDel" column="is_del"/>
|
|
|
+ <result property="orderBeginTime" column="order_begin_time"/>
|
|
|
+ <result property="orderEndTime" column="order_end_time"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ <result property="deptName" column="dept_name"/>
|
|
|
+ <result property="dictLabel" column="dict_label"/>
|
|
|
+ <result property="num" column="num"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectBmProjectVo">
|
|
@@ -56,15 +56,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
left join sys_dict_data sdd on p.project_status = sdd.dict_value and sdd.dict_type = 'project_status'
|
|
|
<where>
|
|
|
<if test="sysDeptId != null">and p.dept_id = #{sysDeptId}</if>
|
|
|
- <if test="name != null and name != ''"> and p.name like concat('%', #{name}, '%')</if>
|
|
|
- <if test="industryCategory != null and industryCategory != ''"> and p.industry_category = #{industryCategory}</if>
|
|
|
- <if test="industry != null and industry != ''"> and p.industry = #{industry}</if>
|
|
|
- <if test="projectStatus != null "> and p.project_status = #{projectStatus}</if>
|
|
|
- <if test="deptName != null and deptName != ''"> and d.dept_name = #{deptName}</if>
|
|
|
- <if test="totAmt != null "> and p.tot_amt = #{totAmt}</if>
|
|
|
- <if test="isDel != null "> and p.is_del = #{isDel}</if>
|
|
|
- <if test="beginTime != null "> and p.create_time >= #{beginTime}</if>
|
|
|
- <if test="endTime != null "> and p.create_time <= #{endTime}</if>
|
|
|
+ <if test="name != null and name != ''">and p.name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="industryCategory != null and industryCategory != ''">and p.industry_category =
|
|
|
+ #{industryCategory}
|
|
|
+ </if>
|
|
|
+ <if test="industry != null and industry != ''">and p.industry = #{industry}</if>
|
|
|
+ <if test="projectStatus != null ">and p.project_status = #{projectStatus}</if>
|
|
|
+ <if test="deptName != null and deptName != ''">and d.dept_name = #{deptName}</if>
|
|
|
+ <if test="totAmt != null ">and p.tot_amt = #{totAmt}</if>
|
|
|
+ <if test="isDel != null ">and p.is_del = #{isDel}</if>
|
|
|
+ <if test="beginTime != null ">and p.create_time >= #{beginTime}</if>
|
|
|
+ <if test="endTime != null ">and p.create_time <= #{endTime}</if>
|
|
|
</where>
|
|
|
order by p.create_time DESC
|
|
|
</select>
|
|
@@ -92,13 +94,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
bm_project p
|
|
|
left join sys_dict_data sdd on p.project_status = sdd.dict_value and sdd.dict_type = 'project_status'
|
|
|
<where>
|
|
|
- p.is_del = '0' and
|
|
|
- sdd.dict_value=(sdd.dict_value<![CDATA[>>]]>1)<![CDATA[<<]]>1
|
|
|
- <if test="deptId != null"> and p.dept_id = #{deptId}</if>
|
|
|
+ p.is_del = '0' and
|
|
|
+ sdd.dict_value=(sdd.dict_value<![CDATA[>>]]>1)<![CDATA[<<]]>1
|
|
|
+ <if test="deptId != null">and p.dept_id = #{deptId}</if>
|
|
|
</where>
|
|
|
order by p.create_time DESC
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectBmProjectById" parameterType="Long" resultMap="BmProjectResult">
|
|
|
SELECT
|
|
|
p.id,
|
|
@@ -125,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
left join sys_dict_data sdd on p.project_status = sdd.dict_value and sdd.dict_type = 'project_status'
|
|
|
where p.id = #{id} and p.is_del = '0'
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertBmProject" parameterType="BmProject" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into bm_project
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -144,7 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="orderBeginTime != null">order_begin_time,</if>
|
|
|
<if test="orderEndTime != null">order_end_time,</if>
|
|
|
<if test="remark != null">remark,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
@@ -161,7 +163,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="orderBeginTime != null">#{orderBeginTime},</if>
|
|
|
<if test="orderEndTime != null">#{orderEndTime},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateBmProject" parameterType="BmProject">
|
|
@@ -186,37 +188,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
-<!-- <delete id="deleteBmProjectById" parameterType="Long">
|
|
|
- delete from bm_project where id = #{id}
|
|
|
- </delete>-->
|
|
|
+ <!-- <delete id="deleteBmProjectById" parameterType="Long">
|
|
|
+ delete from bm_project where id = #{id}
|
|
|
+ </delete>-->
|
|
|
|
|
|
<update id="deleteBmProjectById" parameterType="Long">
|
|
|
update bm_project set is_del = '1' where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
-<!-- <delete id="deleteBmProjectByIds" parameterType="String">
|
|
|
- delete from bm_project where id in
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </delete>-->
|
|
|
+ <!-- <delete id="deleteBmProjectByIds" parameterType="String">
|
|
|
+ delete from bm_project where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>-->
|
|
|
|
|
|
<update id="deleteBmProjectByIds" parameterType="String">
|
|
|
- update bm_project set is_del = '1' where id in
|
|
|
+ update bm_project set is_del = '1' where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|
|
|
|
|
|
- <select id="selectStatisticsList" resultMap="BmProjectResult">
|
|
|
+ <select id="selectStatisticsList" resultMap="BmProjectResult">
|
|
|
<include refid="selectBmProjectVo"></include>
|
|
|
- <where> is_del = '0'
|
|
|
- <if test="deptId != -1">and dept_id = #{deptId}</if>
|
|
|
- and project_status in
|
|
|
- <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
+ <where>is_del = '0'
|
|
|
+ <if test="deptId != -1">and dept_id = #{deptId}</if>
|
|
|
+ and project_status in
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
</where>
|
|
|
order by create_time DESC
|
|
|
</select>
|
|
@@ -237,7 +239,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
|
|
|
- <select id="selectProjectContractEharts" parameterType="string" resultType="com.ruoyi.system.domain.vo.BmDeptPlanVo">
|
|
|
+ <select id="selectProjectContractEharts" parameterType="string"
|
|
|
+ resultType="com.ruoyi.system.domain.vo.BmDeptPlanVo">
|
|
|
SELECT
|
|
|
d.dept_name AS deptName,
|
|
|
ifnull( sum( p.tot_amt ), 0 ) AS totAmt,
|
|
@@ -256,13 +259,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
|
|
|
-
|
|
|
- <select id="selectBmProjectInProjectStatus" resultMap="BmProjectResult">
|
|
|
+ <select id="selectBmProjectInProjectStatus" resultMap="BmProjectResult">
|
|
|
<include refid="selectBmProjectVo"></include>
|
|
|
where project_status = 1 and is_del = 0 group by dept_id
|
|
|
</select>
|
|
|
|
|
|
- <select id="indexInfo" resultMap="BmProjectResult">
|
|
|
- select count(id) as num,project_status from bm_project where is_del = '0' group by project_status
|
|
|
+ <select id="indexInfo" resultMap="BmProjectResult">
|
|
|
+ select count(id) as num,project_status from bm_project
|
|
|
+ <where>
|
|
|
+ is_del = '0'
|
|
|
+ <if test="deptId != null and deptId != -1">and dept_id = #{deptId}</if>
|
|
|
+ </where>
|
|
|
+ group by project_status
|
|
|
</select>
|
|
|
</mapper>
|