44 lines
1.8 KiB
XML
44 lines
1.8 KiB
XML
<?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.rzyc.mapper.GovWarningMapper">
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="BaseResultMap" type="com.rzyc.model.GovWarning">
|
|
<id column="warn_id" property="warnId" />
|
|
<result column="content" property="content" />
|
|
<result column="target_id" property="targetId" />
|
|
<result column="type" property="type" />
|
|
<result column="warn_state" property="warnState" />
|
|
<result column="warn_time" property="warnTime" />
|
|
<result column="solve_state" property="solveState" />
|
|
<result column="create_time" property="createTime" />
|
|
<result column="create_by" property="createBy" />
|
|
<result column="modify_time" property="modifyTime" />
|
|
<result column="modify_by" property="modifyBy" />
|
|
</resultMap>
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="Base_Column_List">
|
|
warn_id, content, target_id, type, warn_time, create_time, create_by, modify_time, modify_by
|
|
</sql>
|
|
|
|
<select id="selectAll" resultMap="BaseResultMap">
|
|
select gw.* from gov_warning gw where gw.type = #{warnDto.type} and gw.warn_state = #{warnDto.warnState}
|
|
</select>
|
|
|
|
<select id="warnList" resultMap="BaseResultMap">
|
|
SELECT * FROM gov_warning gw
|
|
<where>
|
|
<if test="condition != null and condition != ''">
|
|
and gw.content like concat('%',#{condition},'%')
|
|
</if>
|
|
</where>
|
|
ORDER BY gw.warn_time asc
|
|
</select>
|
|
|
|
<select id="countNum" resultType="int" parameterType="Integer">
|
|
select count(gw.warn_id) from gov_warning gw where gw.type = #{type} and gw.solve_state = '1'
|
|
</select>
|
|
|
|
</mapper>
|