<?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.ycl.mapper.caseHandler.WritMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ycl.entity.caseHandler.Writ">
|
<id column="base_case_id" property="baseCaseId"/>
|
<result column="illegal_building_id" property="illegalBuildingId"/>
|
<result column="writ_type" property="writType"/>
|
<result column="writ_code" property="writCode"/>
|
<result column="illegal_type" property="illegalType"/>
|
<result column="send_time" property="sendTime"/>
|
<result column="limit_time" property="limitTime"/>
|
<result column="send_content" property="sendContent"/>
|
<result column="rectify_time" property="rectifyTime"/>
|
<result column="rectify_situation" property="rectifySituation"/>
|
<result column="remark" property="remark"/>
|
<result column="writ_pic" property="writPic"/>
|
<result column="original_pic" property="originalPic"/>
|
<result column="rectified_pic" property="rectifiedPic"/>
|
<result column="other_pic" property="otherPic"/>
|
<result column="create_user" property="createUser"/>
|
<result column="create_time" property="createTime"/>
|
</resultMap>
|
|
<resultMap id="VoMap" type="com.ycl.vo.writ.WritVO" extends="BaseResultMap">
|
<result column="writ_type_name" property="writTypeName" jdbcType="VARCHAR"/>
|
<result column="category_name" property="categoryName" jdbcType="VARCHAR"/>
|
<result column="event_code" property="eventCode" jdbcType="VARCHAR"/>
|
<result column="template_code" property="templateCode" jdbcType="VARCHAR"/>
|
|
</resultMap>
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
base_case_id
|
, illegal_building_id, writ_type, writ_code, illegal_type, send_time, limit_time, send_content, rectify_time, rectify_situation, remark, writ_pic, original_pic, rectified_pic, othen_pic, create_user, create_time
|
</sql>
|
<update id="deleteValueByCaseId">
|
update ums_writ set value = null where base_case_id = #{baseCaseId}
|
</update>
|
<!-- <delete id="deleteValueByCaseId">-->
|
<!-- delete from ums_writ where base_case_id = #{baseCaseId}-->
|
<!-- </delete>-->
|
<select id="selectWritPage" resultMap="VoMap">
|
SELECT w.*, wt.`name` as writ_type_name,bc.`code` event_code,dd.`name` category_name,wt.code template_code
|
FROM ums_writ w
|
LEFT JOIN ums_writ_template wt on w.writ_type = wt.id
|
LEFT JOIN ums_illegal_building ib on w.illegal_building_id = ib.base_case_id
|
LEFT JOIN ums_data_dictionary dd on ib.category_id = dd.id
|
LEFT JOIN ums_base_case bc on ib.base_case_id = bc.id
|
<where>
|
w.value is not null
|
<if test="keyword != null">
|
w.writ_code like CONCAT('%',#{keyword},'%')
|
or bc.`code` like CONCAT('%',#{keyword},'%')
|
or wt.name like CONCAT('%',#{keyword},'%')
|
</if>
|
</where>
|
order by w.create_time desc
|
</select>
|
|
</mapper>
|