| | |
| | | AND g.project_id = #{projectId} |
| | | </select> |
| | | |
| | | <!--查询巡查项树数据--> |
| | | <!-- <select id="getPatrolGroupTree" resultType="org.springblade.core.tool.node.TreeNode" >--> |
| | | <!-- (--> |
| | | <!-- SELECT--> |
| | | <!-- spg.id,--> |
| | | <!-- spg.name,--> |
| | | <!-- 0 as parentId,--> |
| | | <!-- (--> |
| | | <!-- SELECT--> |
| | | <!-- CASE WHEN count(1) > 0 THEN 1 ELSE 0 END--> |
| | | <!-- FROM--> |
| | | <!-- jczz_patrol_group_item--> |
| | | <!-- WHERE--> |
| | | <!-- group_id = spg.id and is_deleted = 0--> |
| | | <!-- ) AS "has_children"--> |
| | | <!-- FROM jczz_patrol_group spg where spg.is_deleted = 0--> |
| | | <!-- )--> |
| | | <!-- union all--> |
| | | <!-- (--> |
| | | <!-- SELECT--> |
| | | <!-- spgi.id,--> |
| | | <!-- spgi.items_name as name,--> |
| | | <!-- spgi.group_id as parentId,--> |
| | | <!-- false AS hasChildren--> |
| | | <!-- FROM jczz_patrol_group_item spgi where spgi.is_deleted = 0--> |
| | | <!-- )--> |
| | | <!-- </select>--> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="patrolGroupResultMap" type="org.springblade.modules.patrol.vo.PatrolGroupVO"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | <collection property="patrolGroupItemList" javaType="java.util.List" select="selectPatrolGroupItem" |
| | | column="id" |
| | | ofType="org.springblade.modules.patrol.vo.PatrolGroupItemVO" autoMapping="true"> |
| | | </collection> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectPatrolGroupItem" resultType="org.springblade.modules.patrol.vo.PatrolGroupItemVO"> |
| | | select |
| | | id, |
| | | group_id, |
| | | items_name, |
| | | description, |
| | | create_user, |
| | | create_time, |
| | | update_time, |
| | | is_deleted, |
| | | type |
| | | from |
| | | jczz_patrol_group_item |
| | | where group_id = #{houseCode} and is_deleted = 0 |
| | | </select> |
| | | |
| | | <select id="selectPatrolGroupPage" resultMap="patrolGroupResultMap"> |
| | | select * from jczz_patrol_group |
| | | <where> |
| | | <if test="patrolGroup.id != null "> and id = #{patrolGroup.id}</if> |
| | | <if test="patrolGroup.name != null and patrolGroup.name != ''"> and name = #{patrolGroup.name}</if> |
| | | <if test="patrolGroup.createUser != null "> and create_user = #{patrolGroup.createUser}</if> |
| | | <if test="patrolGroup.createTime != null "> and create_time = #{patrolGroup.createTime}</if> |
| | | <if test="patrolGroup.updateTime != null "> and update_time = #{patrolGroup.updateTime}</if> |
| | | <if test="patrolGroup.isDeleted != null "> and is_deleted = #{patrolGroup.isDeleted}</if> |
| | | <if test="patrolGroup.type != null "> and type = #{patrolGroup.type}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--查询巡查项树数据--> |
| | | <select id="getPatrolGroupTree" resultType="org.springblade.core.tool.node.TreeNode" > |
| | |
| | | WHERE |
| | | group_id = spg.id and is_deleted = 0 |
| | | ) AS "has_children" |
| | | FROM jczz_patrol_group spg where spg.is_deleted = 0 |
| | | FROM jczz_patrol_group spg |
| | | <where> |
| | | spg.is_deleted = 0 |
| | | <if test="param1 != null"> |
| | | and spg.type = #{param1} |
| | | </if> |
| | | </where> |
| | | order by spg.create_time desc |
| | | </select> |
| | | |
| | | <!--查询巡查项树数据--> |
| | | <select id="getPatrolGroupItemTree" resultType="org.springblade.core.tool.node.TreeNode" > |
| | | SELECT |
| | | spgi.id, |
| | | spgi.items_name as title, |
| | | spgi.group_id as parentId, |
| | | false AS hasChildren |
| | | spgi.id, |
| | | spgi.items_name as title, |
| | | spgi.group_id as parentId, |
| | | false AS hasChildren |
| | | FROM jczz_patrol_group_item spgi where spgi.is_deleted = 0 |
| | | <if test="param1 != null"> |
| | | and spgi.type = #{param1} |
| | | </if> |
| | | order by spgi.create_time desc |
| | | </select> |
| | | <select id="getPatrolGroupByItemId" resultType="org.springblade.modules.patrol.entity.PatrolGroup"> |
| | |
| | | <resultMap id="patrolGroupDTO" type="org.springblade.modules.patrol.dto.PatrolGroupDTO"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="gname"/> |
| | | <collection property="patrolRecordVOList" javaType="java.util.List" ofType="org.springblade.modules.patrol.vo.PatrolRecordVO"> |
| | | <result property="id" column="rId"/> |
| | | <result property="videos" column="videos" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> |
| | | <result property="images" column="images" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> |
| | | <result property="status" column="status"/> |
| | | <result property="isDeleted" column="isDeleted"/> |
| | | <result property="itemId" column="itemId"/> |
| | | <result property="itemsName" column="itemsName"/> |
| | | <result property="taskId" column="taskId"/> |
| | | <result property="solution" column="solution"/> |
| | | <result property="content" column="content"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | </select> |
| | | |
| | | |
| | | <!-- <resultMap type="org.springblade.modules.dto.PatrolGroupItemDTO" id="PatrolGroupItemDTOResult">--> |
| | | <!-- <result property="id" column="id" />--> |
| | | <!-- <result property="groupId" column="group_id" />--> |
| | | <!-- <result property="itemsName" column="items_name" />--> |
| | | <!-- <result property="description" column="description" />--> |
| | | <!-- <result property="createUser" column="create_user" />--> |
| | | <!-- <result property="createTime" column="create_time" />--> |
| | | <!-- <result property="updateTime" column="update_time" />--> |
| | | <!-- <result property="isDeleted" column="is_deleted" />--> |
| | | <!-- </resultMap>--> |
| | | |
| | | <sql id="selectPatrolGroupItem"> |
| | | select |
| | | id, |
| | | group_id, |
| | | items_name, |
| | | description, |
| | | create_user, |
| | | create_time, |
| | | update_time, |
| | | is_deleted |
| | | from |
| | | jczz_patrol_group_item |
| | | </sql> |
| | | |
| | | <!-- <select id="selectPatrolGroupItemById" parameterType="long" resultMap="PatrolGroupItemDTOResult">--> |
| | | <!-- <include refid="selectPatrolGroupItem"/>--> |
| | |
| | | <!-- id = #{id}--> |
| | | <!-- </select>--> |
| | | |
| | | <!-- <select id="selectPatrolGroupItemList" parameterType="org.springblade.modules.dto.PatrolGroupItemDTO" resultMap="PatrolGroupItemDTOResult">--> |
| | | <!-- <select id="selectPatrolGroupItemList" parameterType="org.springblade.modules.patrol.dto.PatrolGroupItemDTO" resultMap="PatrolGroupItemDTOResult">--> |
| | | <!-- <include refid="selectPatrolGroupItem"/>--> |
| | | <!-- <where>--> |
| | | <!-- <if test="id != null "> and id = #{id}</if>--> |