Commit eca0c53d authored by 周昊's avatar 周昊

1、修改项目列表筛选,导出删除

parent 8637f028
...@@ -20,35 +20,33 @@ public class LedgerProject extends BaseEntityClean ...@@ -20,35 +20,33 @@ public class LedgerProject extends BaseEntityClean
private Long id; private Long id;
/** 项目名称 */ /** 项目名称 */
@Excel(name = "项目名称") @Excel(name = "项目名称",sort = 1)
private String name; private String name;
/** 项目类型 */ /** 项目类型 */
@Excel(name = "项目类型") @Excel(name = "项目类型",sort = 2)
private String type; private String type;
/** 项目业态 */ /** 项目业态 */
@Excel(name = "项目业态") @Excel(name = "项目业态",sort = 3)
private String business; private String business;
/** 组织机构id */ /** 组织机构id */
@Excel(name = "组织机构id")
private Long deptId; private Long deptId;
/** 所在城市 */ /** 所在城市 */
@Excel(name = "所在城市") @Excel(name = "所在城市",sort = 5)
private String city; private String city;
/** 详细地址 */ /** 详细地址 */
@Excel(name = "详细地址") @Excel(name = "详细地址",sort = 6)
private String address; private String address;
/** 0-关联 1-自建 */ /** 0-关联 1-自建 */
@Excel(name = "0-关联 1-自建")
private String source; private String source;
/** 状态(0正常 1停用) */ /** 状态(0正常 1停用) */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用") @Excel(name = "状态", dictType = "sys_normal_disable",sort = 7)
private String status; private String status;
/** 删除标志(0代表存在 1代表删除) */ /** 删除标志(0代表存在 1代表删除) */
...@@ -57,6 +55,7 @@ public class LedgerProject extends BaseEntityClean ...@@ -57,6 +55,7 @@ public class LedgerProject extends BaseEntityClean
* 部门名称名称 * 部门名称名称
*/ */
@TableField(exist = false) @TableField(exist = false)
@Excel(name = "所属区域",sort = 4)
private String deptName; private String deptName;
/** /**
......
...@@ -26,21 +26,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -26,21 +26,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectLedgerProjectList" parameterType="com.censoft.censoftrongtong.domain.LedgerProject" resultMap="LedgerProjectResult"> <select id="selectLedgerProjectList" parameterType="com.censoft.censoftrongtong.domain.LedgerProject" resultMap="LedgerProjectResult">
SELECT p.id, p.NAME, p.type,p.business, p.dept_id, d.dept_name, p.city, p.address, p.source, p.STATUS, p.del_flag, p.create_by, p.create_time, p.update_by, p.update_time FROM ledger_project p LEFT JOIN sys_dept d ON p.dept_id = d.dept_id SELECT
p.id,
p.NAME,
p.type,
p.business,
p.dept_id,
d.dept_name,
p.city,
p.address,
p.source,
p.STATUS,
p.del_flag,
p.create_by,
p.create_time,
p.update_by,
p.update_time
FROM
ledger_project p
LEFT JOIN sys_dept d ON p.dept_id = d.dept_id
<where> <where>
<if test="name != null and name != ''"> and p.name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and p.name like concat('%', #{name}, '%')</if>
<if test="type != null and type != ''"> and p.type = #{type}</if> <if test="type != null and type != ''"> and p.type like concat('%', #{type}, '%')</if>
<if test="deptId != null "> and p.dept_id = #{deptId}</if> <if test="business != null and business != ''"> and p.business = #{business}</if>
<if test="city != null and city != ''"> and p.city = #{city}</if> <if test="deptId != null "> and ( d.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors) )</if>
<if test="address != null and address != ''"> and p.address = #{address}</if> <if test="city != null and city != ''"> and p.city like concat('%', #{city}, '%')</if>
<if test="address != null and address != ''"> and p.address like concat('%', #{address}, '%')</if>
<if test="source != null and source != ''"> and p.source = #{source}</if> <if test="source != null and source != ''"> and p.source = #{source}</if>
<if test="status != null and status != ''"> and p.status = #{status}</if> <if test="status != null and status != ''"> and p.status = #{status}</if>
AND p.del_flag = '0'
</where> </where>
</select> </select>
<select id="selectLedgerProjectById" parameterType="Long" resultMap="LedgerProjectResult"> <select id="selectLedgerProjectById" parameterType="Long" resultMap="LedgerProjectResult">
<include refid="selectLedgerProjectVo"/> <include refid="selectLedgerProjectVo"/>
where id = #{id} where id = #{id} AND del_flag = '0'
</select> </select>
<select id="getProjectListByDeptId" parameterType="com.censoft.censoftrongtong.domain.LedgerProject" resultMap="LedgerProjectResult"> <select id="getProjectListByDeptId" parameterType="com.censoft.censoftrongtong.domain.LedgerProject" resultMap="LedgerProjectResult">
SELECT SELECT
...@@ -121,11 +141,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -121,11 +141,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteLedgerProjectById" parameterType="Long"> <delete id="deleteLedgerProjectById" parameterType="Long">
delete from ledger_project where id = #{id} update ledger_project set del_flag = '1' where id = #{id}
</delete> </delete>
<delete id="deleteLedgerProjectByIds" parameterType="String"> <delete id="deleteLedgerProjectByIds" parameterType="String">
delete from ledger_project where id in update ledger_project set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment