|
@@ -0,0 +1,128 @@
|
|
|
+package thyyxxk.webserver.dao.his.dictionary;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
+import org.apache.ibatis.annotations.Mapper;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
+import org.apache.ibatis.annotations.Select;
|
|
|
+import org.apache.ibatis.annotations.Update;
|
|
|
+import thyyxxk.webserver.entity.dictionary.ZdUnitCode;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Mapper
|
|
|
+public interface ZdUnitCodeDao extends BaseMapper<ZdUnitCode> {
|
|
|
+
|
|
|
+ @Select("<script>" +
|
|
|
+ " select d.* from zd_unit_code d " +
|
|
|
+ " where isnull(d.py_code,'') like '%#{text}' " +
|
|
|
+ " and isnull(d.d_code,'') like '%#{text}' " +
|
|
|
+ " and (isnull(d.code,'') like '%#{text}' or isnull(d.n_code,'') like '%#{text}') " +
|
|
|
+ " and isnull(d.name,'') like '%#{text}' " +
|
|
|
+ "</script>")
|
|
|
+ List<ZdUnitCode> selectZdUnitCode(@Param("text") String text);
|
|
|
+
|
|
|
+ @Select("<script>" +
|
|
|
+ " select d.code, " +
|
|
|
+ " d.name, " +
|
|
|
+ " d.class_code, " +
|
|
|
+ " c.name as className, " +
|
|
|
+ " d.py_code, " +
|
|
|
+ " d.d_code, " +
|
|
|
+ " d.mz_flag, " +
|
|
|
+ " d.del_flag, " +
|
|
|
+ " d.n_code, " +
|
|
|
+ " d.yj_flag, " +
|
|
|
+ " d.mzrc_flag, " +
|
|
|
+ " d.parent_code, " +
|
|
|
+ " f.name as parentName, " +
|
|
|
+ " '0' as new_flag, " +
|
|
|
+ " d.gh_charge_flag, " +
|
|
|
+ " d.xnh_dept_code, " +
|
|
|
+ " d.xnh_dept_name, " +
|
|
|
+ " d.supply_flag, " +
|
|
|
+ " d.ghjz_flag, " +
|
|
|
+ " d.office_pos " +
|
|
|
+ " from zd_unit_code d with(nolock) " +
|
|
|
+ "left join zd_unit_class c " +
|
|
|
+ " on d.class_code = c.code " +
|
|
|
+ "left join zd_unit_code f with(nolock) " +
|
|
|
+ " on isnull(f.del_flag,'') <> '1' and d.parent_code = f.code " +
|
|
|
+ " where isnull(d.py_code,'') like ('%' + upper(#{text}) + '%') " +
|
|
|
+ " and isnull(d.d_code,'') like ('%' + upper(#{text}) + '%') " +
|
|
|
+ " and (isnull(d.code,'') like ('%' + upper(#{text}) + '%') or isnull(d.n_code,'') like '%${text}%') " +
|
|
|
+ " and isnull(d.name,'') like '%${text}%' " +
|
|
|
+ "</script>")
|
|
|
+ List<ZdUnitCode> selectDeptDictAll(@Param("text") String text);
|
|
|
+
|
|
|
+ @Select(" select u.code, u.name, u.py_code, u.d_code, n_code from zd_unit_code u where isnull(del_flag,'') <> '1' ")
|
|
|
+ List<ZdUnitCode> selectDeptDictForEffective();
|
|
|
+
|
|
|
+ @Select(" select u.* from zd_unit_code u where u.code = #{code} ")
|
|
|
+ ZdUnitCode selectDeptDictByCode(@Param("code") String code);
|
|
|
+
|
|
|
+ @Update("<script>" +
|
|
|
+ "update zd_unit_code " +
|
|
|
+ "<trim prefix=\"set\" suffixOverrides=\",\">" +
|
|
|
+ "<if test=\"code != null\">" +
|
|
|
+ "id = #{code}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"name != null \">" +
|
|
|
+ "name = #{name}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"classCode != null\">" +
|
|
|
+ "class_code = #{classCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"pyCode != null\">" +
|
|
|
+ "py_code = #{pyCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"dCode != null\">" +
|
|
|
+ "d_code = #{dCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"mzFlag != null\">" +
|
|
|
+ "mz_flag = #{mzFlag}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"delFlag != null\">" +
|
|
|
+ "del_flag = #{delFlag}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"opId != null\">" +
|
|
|
+ "op_id = #{opId}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"opDate != null\">" +
|
|
|
+ "op_date = #{opDate}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"nCode != null\">" +
|
|
|
+ "n_code = #{nCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"yjFlag != null\">" +
|
|
|
+ "yj_flag = #{yjFlag}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"mzrcFlag != null\">" +
|
|
|
+ "mzrc_flag = #{mzrcFlag}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"parentCode != null\">" +
|
|
|
+ "parent_code = #{parentCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"ghChargeFlag != null\">" +
|
|
|
+ "gh_charge_flag = #{ghChargeFlag}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"xnhDeptCode != null\">" +
|
|
|
+ "xnh_dept_code = #{xnhDeptCode}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"xnhDeptName != null\">" +
|
|
|
+ "xnh_dept_name = #{xnhDeptName}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"supplyFlag != null\">" +
|
|
|
+ "supply_flag = #{supplyFlag}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"ghjzFlag != null\">" +
|
|
|
+ "ghjz_flag = #{ghjzFlag}, " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"officePos != null\">" +
|
|
|
+ "office_pos = #{officePos}, " +
|
|
|
+ "</if>" +
|
|
|
+ "</trim>" +
|
|
|
+ "where code = #{code} " +
|
|
|
+ "</script>")
|
|
|
+ int updateDeptDictByCode(ZdUnitCode zdUnitCode);
|
|
|
+
|
|
|
+}
|