|
|
|
@ -18,20 +18,20 @@
|
|
|
|
|
remark,dept_code
|
|
|
|
|
</sql>
|
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
power_dept.dept_id,
|
|
|
|
|
power_dept.dept_name,
|
|
|
|
|
power_dept.dict_id,
|
|
|
|
|
power_dept.effective,
|
|
|
|
|
power_dept.create_date,
|
|
|
|
|
power_dept.creater,
|
|
|
|
|
power_dept.update_date,
|
|
|
|
|
power_dept.updater,
|
|
|
|
|
power_dept.remark,
|
|
|
|
|
power_sys_dict.hospital_name,
|
|
|
|
|
power_dept.dept_code
|
|
|
|
|
select
|
|
|
|
|
power_dept.dept_id,
|
|
|
|
|
power_dept.dept_name,
|
|
|
|
|
power_dept.dict_id,
|
|
|
|
|
power_dept.effective,
|
|
|
|
|
power_dept.create_date,
|
|
|
|
|
power_dept.creater,
|
|
|
|
|
power_dept.update_date,
|
|
|
|
|
power_dept.updater,
|
|
|
|
|
power_dept.remark,
|
|
|
|
|
power_sys_dict.hospital_name,
|
|
|
|
|
power_dept.dept_code
|
|
|
|
|
from power_dept
|
|
|
|
|
LEFT JOIN power_sys_dict ON power_sys_dict.dict_id = power_dept.dict_id
|
|
|
|
|
LEFT JOIN power_sys_dict ON power_sys_dict.dict_id = power_dept.dict_id
|
|
|
|
|
where power_dept.dept_id = #{deptId,jdbcType=INTEGER}
|
|
|
|
|
</select>
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
@ -39,14 +39,14 @@
|
|
|
|
|
where dept_id = #{deptId,jdbcType=INTEGER}
|
|
|
|
|
</delete>
|
|
|
|
|
<insert id="insert" parameterType="com.manage.entity.Power_Dept">
|
|
|
|
|
insert into power_dept (dept_id, dept_name, dict_id,
|
|
|
|
|
effective, create_date, creater,
|
|
|
|
|
update_date, updater, remark,dept_code
|
|
|
|
|
)
|
|
|
|
|
insert into power_dept (dept_id, dept_name, dict_id,
|
|
|
|
|
effective, create_date, creater,
|
|
|
|
|
update_date, updater, remark,dept_code
|
|
|
|
|
)
|
|
|
|
|
values (#{deptId,jdbcType=INTEGER}, #{deptName,jdbcType=VARCHAR}, #{dictId,jdbcType=INTEGER},
|
|
|
|
|
#{effective,jdbcType=INTEGER}, #{createDate,jdbcType=CHAR}, #{creater,jdbcType=VARCHAR},
|
|
|
|
|
#{updateDate,jdbcType=CHAR}, #{updater,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},#{deptCode,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
#{effective,jdbcType=INTEGER}, #{createDate,jdbcType=CHAR}, #{creater,jdbcType=VARCHAR},
|
|
|
|
|
#{updateDate,jdbcType=CHAR}, #{updater,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},#{deptCode,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertSelective" parameterType="com.manage.entity.Power_Dept">
|
|
|
|
|
insert into power_dept
|
|
|
|
@ -151,31 +151,29 @@
|
|
|
|
|
<update id="updateByPrimaryKey" parameterType="com.manage.entity.Power_Dept">
|
|
|
|
|
update power_dept
|
|
|
|
|
set dept_name = #{deptName,jdbcType=VARCHAR},
|
|
|
|
|
dict_id = #{dictId,jdbcType=INTEGER},
|
|
|
|
|
effective = #{effective,jdbcType=INTEGER},
|
|
|
|
|
create_date = #{createDate,jdbcType=CHAR},
|
|
|
|
|
creater = #{creater,jdbcType=VARCHAR},
|
|
|
|
|
update_date = #{updateDate,jdbcType=CHAR},
|
|
|
|
|
updater = #{updater,jdbcType=VARCHAR},
|
|
|
|
|
remark = #{remark,jdbcType=VARCHAR},
|
|
|
|
|
dept_code = #{deptCode,jdbcType=VARCHAR}
|
|
|
|
|
dict_id = #{dictId,jdbcType=INTEGER},
|
|
|
|
|
effective = #{effective,jdbcType=INTEGER},
|
|
|
|
|
create_date = #{createDate,jdbcType=CHAR},
|
|
|
|
|
creater = #{creater,jdbcType=VARCHAR},
|
|
|
|
|
update_date = #{updateDate,jdbcType=CHAR},
|
|
|
|
|
updater = #{updater,jdbcType=VARCHAR},
|
|
|
|
|
remark = #{remark,jdbcType=VARCHAR},
|
|
|
|
|
dept_code = #{deptCode,jdbcType=VARCHAR}
|
|
|
|
|
where dept_id = #{deptId,jdbcType=INTEGER}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--2019-4-22 ly -->
|
|
|
|
|
<select id="findSomeByMore" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
power_dept.dept_id,
|
|
|
|
|
power_dept.dept_name,
|
|
|
|
|
power_dept.dict_id,
|
|
|
|
|
power_dept.effective,
|
|
|
|
|
power_dept.create_date,
|
|
|
|
|
power_dept.creater,
|
|
|
|
|
power_dept.update_date,
|
|
|
|
|
power_dept.updater,
|
|
|
|
|
power_dept.remark,
|
|
|
|
|
power_sys_dict.hospital_name
|
|
|
|
|
power_dept.dept_id,
|
|
|
|
|
power_dept.dept_name,
|
|
|
|
|
power_dept.dict_id,
|
|
|
|
|
power_dept.effective,
|
|
|
|
|
power_dept.create_date,
|
|
|
|
|
power_dept.creater,
|
|
|
|
|
power_dept.update_date,
|
|
|
|
|
power_dept.updater,
|
|
|
|
|
power_dept.remark,
|
|
|
|
|
power_sys_dict.hospital_name
|
|
|
|
|
from power_dept
|
|
|
|
|
left join power_sys_dict on power_sys_dict.dict_id = power_dept.dict_id
|
|
|
|
|
where 1 = 1
|
|
|
|
@ -196,20 +194,20 @@
|
|
|
|
|
</if>
|
|
|
|
|
ORDER BY create_date DESC,power_dept.dept_id DESC
|
|
|
|
|
<if test="offset != null and limit != null">
|
|
|
|
|
LIMIT #{offset},#{limit}
|
|
|
|
|
LIMIT #{offset},#{limit}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<!--验证同一医院科室名不能重复-->
|
|
|
|
|
<select id="checkDeptName" resultMap="BaseResultMap" parameterType="java.lang.String">
|
|
|
|
|
SELECT
|
|
|
|
|
dept_id
|
|
|
|
|
FROM
|
|
|
|
|
power_dept
|
|
|
|
|
WHERE
|
|
|
|
|
dept_name = #{deptName}
|
|
|
|
|
<if test="dictId != null">
|
|
|
|
|
AND dict_id = #{dictId}
|
|
|
|
|
</if>
|
|
|
|
|
SELECT
|
|
|
|
|
dept_id
|
|
|
|
|
FROM
|
|
|
|
|
power_dept
|
|
|
|
|
WHERE
|
|
|
|
|
dept_name = #{deptName}
|
|
|
|
|
<if test="dictId != null">
|
|
|
|
|
AND dict_id = #{dictId}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getTotal" resultType="int">
|
|
|
|
|
SELECT count(1) FROM power_dept WHERE 1 = 1
|
|
|
|
@ -237,10 +235,10 @@
|
|
|
|
|
from power_dept
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="list !=null and list!=''">
|
|
|
|
|
and dept_id in
|
|
|
|
|
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
and dept_id in
|
|
|
|
|
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectDeptByDeptName" parameterType="HashMap" resultMap="BaseResultMap">
|
|
|
|
@ -258,56 +256,56 @@
|
|
|
|
|
<!--根据权限查询医院科室树-->
|
|
|
|
|
<select id="selectDeptByUserId" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
|
|
|
|
SELECT
|
|
|
|
|
power_sys_dict.dict_id,
|
|
|
|
|
power_sys_dict.hospital_name,
|
|
|
|
|
power_dept.dept_id,
|
|
|
|
|
power_dept.dept_name
|
|
|
|
|
power_sys_dict.dict_id,
|
|
|
|
|
power_sys_dict.hospital_name,
|
|
|
|
|
power_dept.dept_id,
|
|
|
|
|
power_dept.dept_name
|
|
|
|
|
FROM
|
|
|
|
|
power_dept
|
|
|
|
|
power_dept
|
|
|
|
|
INNER JOIN power_sys_dict ON power_sys_dict.dict_id = power_dept.dict_id
|
|
|
|
|
WHERE
|
|
|
|
|
power_sys_dict.dict_status = 1
|
|
|
|
|
power_sys_dict.dict_status = 1
|
|
|
|
|
AND power_dept.effective = 1
|
|
|
|
|
<if test="userId != null">
|
|
|
|
|
and power_sys_dict.dict_id = (select power_user_dict.dict_id from power_user_dict WHERE power_user_dict.user_id = ${userId})
|
|
|
|
|
</if>
|
|
|
|
|
<if test="userId != null">
|
|
|
|
|
and power_sys_dict.dict_id = (select power_user_dict.dict_id from power_user_dict WHERE power_user_dict.user_id = ${userId})
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<!--根据医院id查科室集合-->
|
|
|
|
|
<select id="selectDeptByDictId" resultMap="BaseResultMap">
|
|
|
|
|
SELECT
|
|
|
|
|
power_dept.dept_id,
|
|
|
|
|
power_dept.dept_name
|
|
|
|
|
<if test="sysFlag != null and sysFlag != ''">
|
|
|
|
|
,power_sys_dict.dept_id checks
|
|
|
|
|
</if>
|
|
|
|
|
power_dept.dept_id,
|
|
|
|
|
power_dept.dept_name
|
|
|
|
|
<if test="sysFlag != null and sysFlag != ''">
|
|
|
|
|
,power_sys_dict.dept_id checks
|
|
|
|
|
</if>
|
|
|
|
|
FROM
|
|
|
|
|
power_dept
|
|
|
|
|
<if test="sysFlag != null and sysFlag != ''">
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
power_sys_dict on power_dept.dept_id = power_sys_dict.dept_id and sys_flag = #{sysFlag}
|
|
|
|
|
</if>
|
|
|
|
|
power_dept
|
|
|
|
|
<if test="sysFlag != null and sysFlag != ''">
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
power_sys_dict on power_dept.dept_id = power_sys_dict.dept_id and sys_flag = #{sysFlag}
|
|
|
|
|
</if>
|
|
|
|
|
WHERE
|
|
|
|
|
effective = 1
|
|
|
|
|
<if test="dictId != null">
|
|
|
|
|
AND
|
|
|
|
|
power_dept.dict_id = #{dictId}
|
|
|
|
|
</if>
|
|
|
|
|
effective = 1
|
|
|
|
|
<if test="dictId != null">
|
|
|
|
|
AND
|
|
|
|
|
power_dept.dict_id = #{dictId}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--批量插入-->
|
|
|
|
|
<insert id="SimpleInsert" parameterType="java.util.List">
|
|
|
|
|
INSERT INTO power_dept(
|
|
|
|
|
dept_id,
|
|
|
|
|
dept_name,
|
|
|
|
|
dict_id,
|
|
|
|
|
effective,
|
|
|
|
|
create_date,
|
|
|
|
|
creater,
|
|
|
|
|
update_date,
|
|
|
|
|
updater,
|
|
|
|
|
remark,
|
|
|
|
|
dept_code
|
|
|
|
|
)
|
|
|
|
|
dept_id,
|
|
|
|
|
dept_name,
|
|
|
|
|
dict_id,
|
|
|
|
|
effective,
|
|
|
|
|
create_date,
|
|
|
|
|
creater,
|
|
|
|
|
update_date,
|
|
|
|
|
updater,
|
|
|
|
|
remark,
|
|
|
|
|
dept_code
|
|
|
|
|
)
|
|
|
|
|
VALUES
|
|
|
|
|
<foreach collection ="list" item="item" index= "index" separator =",">
|
|
|
|
|
(
|
|
|
|
@ -324,9 +322,4 @@
|
|
|
|
|
)
|
|
|
|
|
</foreach >
|
|
|
|
|
</insert>
|
|
|
|
|
<select id="selectByPrimaryKeyDeptId" resultType="com.manage.entity.Power_Dept">
|
|
|
|
|
select *
|
|
|
|
|
from power_dept
|
|
|
|
|
where power_dept.dept_id = #{deptId}
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|