|
|
|
<?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.ruoyi.tc.mapper.UnitMapper">
|
|
|
|
|
|
|
|
<resultMap id="unitResult" type="Unit">
|
|
|
|
<id property="id" column="id" />
|
|
|
|
<result property="userName" column="user_name"/>
|
|
|
|
<result property="nickName" column="nick_name"/>
|
|
|
|
<result property="dwjc" column="dwjc"/>
|
|
|
|
<result property="ssqyprovince" column="ssqyprovince"/>
|
|
|
|
<result property="ssqycity" column="ssqycity"/>
|
|
|
|
<result property="ssqycounty" column="ssqycounty"/>
|
|
|
|
<result property="dwxxdz" column="dwxxdz"/>
|
|
|
|
<result property="sshy" column="sshy"/>
|
|
|
|
<result property="dwlx" column="dwlx"/>
|
|
|
|
<result property="dwbq" column="dwbq"/>
|
|
|
|
<result property="ssjgdw" column="ssjgdw"/>
|
|
|
|
<result property="dwjs" column="dwjs"/>
|
|
|
|
<result property="dwzsxz" column="dwzsxz"/>
|
|
|
|
<result property="gjdw" column="gjdw"/>
|
|
|
|
<result property="rcyyfzbm" column="rcyyfzbm"/>
|
|
|
|
<result property="dwfzrxm" column="dwfzrxm"/>
|
|
|
|
<result property="dwfzrlxfs" column="dwfzrlxfs"/>
|
|
|
|
<result property="dwfzryx" column="dwfzryx"/>
|
|
|
|
<result property="dwfzrzwzc" column="dwfzrzwzc"/>
|
|
|
|
<result property="fgfzrxm" column="fgfzrxm"/>
|
|
|
|
<result property="fgfzrlxfs" column="fgfzrlxfs"/>
|
|
|
|
<result property="fgfzryx" column="fgfzryx"/>
|
|
|
|
<result property="fgfzrzwzc" column="fgfzrzwzc"/>
|
|
|
|
<result property="bmfzrxm" column="bmfzrxm"/>
|
|
|
|
<result property="bmfzrlxfs" column="bmfzrlxfs"/>
|
|
|
|
<result property="bmfzryx" column="bmfzryx"/>
|
|
|
|
<result property="bmfzrzwzc" column="bmfzrzwzc"/>
|
|
|
|
<result property="dylxrxm" column="dylxrxm"/>
|
|
|
|
<result property="dylxrlxfs" column="dylxrlxfs"/>
|
|
|
|
<result property="dylxryx" column="dylxryx"/>
|
|
|
|
<result property="dylxrzwzc" column="dylxrzwzc"/>
|
|
|
|
<result property="gw" column="gw"/>
|
|
|
|
<result property="dtjd" column="dtjd"/>
|
|
|
|
<result property="dtwd" column="dtwd"/>
|
|
|
|
<result property="sjdw" column="sjdw"/>
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
<result property="createId" column="create_id"/>
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
<result property="updateId" column="update_id"/>
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
<result property="remark" column="remark"/>
|
|
|
|
<result property="delFlag" column="del_flag"/>
|
|
|
|
<collection property="otherConcat" javaType="java.util.List" ofType="com.ruoyi.tc.entity.UnitOtherConcat" >
|
|
|
|
<id property="concatId" column="concat_id" />
|
|
|
|
<result property="qtlxrxm" column="qtlxrlxfs" />
|
|
|
|
<result property="qtlxrlxfs" column="qtlxrlxfs" />
|
|
|
|
<result property="qtlxryx" column="qtlxryx" />
|
|
|
|
<result property="qtlxrzwzc" column="qtlxrzwzc" />
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
<result property="createId" column="create_id"/>
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
<result property="updateId" column="update_id"/>
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
<result property="remark" column="remark"/>
|
|
|
|
</collection>
|
|
|
|
<collection property="jcxxList" javaType="java.util.List" ofType="com.ruoyi.tc.entity.ExamineInfo" >
|
|
|
|
<id property="jcid" column="jcid" />
|
|
|
|
<result property="unitId" column="unit_id" />
|
|
|
|
<result property="sj" column="sj" />
|
|
|
|
<result property="xtym" column="xtym" />
|
|
|
|
<result property="xthc" column="xthc" />
|
|
|
|
<result property="dbjb" column="dbjb" />
|
|
|
|
<result property="dwmc" column="dwmc" />
|
|
|
|
<result property="jcjg" column="jcjg" />
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
<result property="createId" column="create_id"/>
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
<result property="updateId" column="update_id"/>
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
<result property="remark" column="remark"/>
|
|
|
|
</collection>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<select id="selectUnitList" parameterType="unit" resultMap="unitResult">
|
|
|
|
select a.* from unit_info a
|
|
|
|
<where>
|
|
|
|
a.del_flag = '0'
|
|
|
|
<if test="req.isSearch == '1' ">
|
|
|
|
and a.nick_name IN (SELECT dwmc FROM asset_current);
|
|
|
|
</if>
|
|
|
|
<if test="req.nickName != null and req.nickName != '' ">
|
|
|
|
and a.nick_name like concat('%',#{req.nickName},'%')
|
|
|
|
</if>
|
|
|
|
<if test="req.dwlx != null">
|
|
|
|
and a.dwlx = #{req.dwlx}
|
|
|
|
</if>
|
|
|
|
<if test="req.userName != null and req.userName != '' ">
|
|
|
|
and a.user_name like concat('%',#{req.userName},'%')
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="getById" parameterType="unit" resultMap="unitResult">
|
|
|
|
select a.*,c.*,e.* from unit_info a
|
|
|
|
left join unit_other_contact c on a.id = c.unit_id
|
|
|
|
left join unit_examine_info e on a.id = e.unit_id
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectByIds" resultType="java.lang.String">
|
|
|
|
select user_name from unit_info where id = #{id}
|
|
|
|
</select>
|
|
|
|
<select id="dwList" resultType="com.ruoyi.tc.entity.Unit">
|
|
|
|
SELECT a.*
|
|
|
|
FROM unit_info a
|
|
|
|
<where>
|
|
|
|
a.nick_name NOT IN (SELECT dwmc FROM asset_task where task_status=1) and
|
|
|
|
a.del_flag = '0'
|
|
|
|
<if test="req.nickName != null and req.nickName != '' ">
|
|
|
|
and a.nick_name like concat('%',#{req.nickName},'%')
|
|
|
|
</if>
|
|
|
|
<if test="req.dwlx != null">
|
|
|
|
and a.dwlx = #{req.dwlx}
|
|
|
|
</if>
|
|
|
|
<if test="req.userName != null and req.userName != '' ">
|
|
|
|
and a.user_name like concat('%',#{req.userName},'%')
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<update id="deleteUnits">
|
|
|
|
update unit_info set del_flag = '2' where id = #{id}
|
|
|
|
</update>
|
|
|
|
<update id="deleteUsers">
|
|
|
|
update sys_user set del_flag = '2' where user_name in
|
|
|
|
<foreach collection="array" item="userNames" open="(" separator="," close=")">
|
|
|
|
#{userNames}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
</mapper>
|