SafetyDetailMapper.xml 2.03 KB
<?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.service.mapper.SafetyDetailMapper">

	<insert id="insert" parameterType="com.ruoyi.service.domain.SafetyDetail">
		insert into safety_detail(
		<if test="safetyId != null and safetyId != ''">safetyId,</if>
		<if test="checkType != null and checkType != ''">checkType,</if>
		<if test="archivalCode != null and archivalCode != ''">archivalCode,</if>
		<if test="title != null and title != ''">title,</if>
		<if test="boxMark != null and boxMark != ''">boxMark,</if>
		<if test="locationCode != null and locationCode != ''">locationCode,</if>
		<if test="archivesState != null and archivesState != ''">archivesState,</if>
		<if test="remedy != null and remedy != ''">remedy,</if>
		createTime
		)values(
		<if test="safetyId != null and safetyId != ''">#{safetyId},</if>
		<if test="checkType != null and checkType != ''">#{checkType},</if>
		<if test="archivalCode != null and archivalCode != ''">#{archivalCode},</if>
		<if test="title != null and title != ''">#{title},</if>
		<if test="boxMark != null and boxMark != ''">#{boxMark},</if>
		<if test="locationCode != null and locationCode != ''">#{locationCode},</if>
		<if test="archivesState != null and archivesState != ''">#{archivesState},</if>
		<if test="remedy != null and remedy != ''">#{remedy},</if>
		sysdate()
		)
	</insert>

	<select id="selectList" resultType="com.ruoyi.service.domain.SafetyDetail" parameterType="com.ruoyi.service.domain.SafetyDetail">
		select * from safety_detail
		<where>
			<if test="safetyId != null and safetyId != ''">
				AND safetyId =#{safetyId}
			</if>
			<if test="checkType != null and checkType != ''">
				AND checkType =#{checkType}
			</if>
		</where>
	</select>

	<select id="selectCountByCheckType" resultType="map" parameterType="com.ruoyi.service.domain.SafetyDetail">
		SELECT count(*) count,checkType FROM `safety_detail`
		where safetyId =#{safetyId}
		GROUP BY checkType
	</select>

</mapper>