| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.RawInspectMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.RawInspect"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="code" column="code" jdbcType="VARCHAR"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="specifications" column="specifications" jdbcType="VARCHAR"/> |
| | | <result property="unit" column="unit" jdbcType="VARCHAR"/> |
| | | <result property="number" column="number" jdbcType="INTEGER"/> |
| | | <result property="insState" column="ins_state" jdbcType="INTEGER"/> |
| | | <result property="judgeState" column="judge_state" jdbcType="INTEGER"/> |
| | | <result property="insTime" column="ins_time" jdbcType="DATE"/> |
| | | <result property="userName" column="user_name" jdbcType="VARCHAR"/> |
| | | <result property="state" column="state" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="DATE"/> |
| | | <result property="updateTime" column="update_time" jdbcType="DATE"/> |
| | | <result property="formTime" column="form_time" jdbcType="DATE"/> |
| | | </resultMap> |
| | | <select id="selectRawInspectsByLimit" resultType="com.yuanchu.mom.pojo.RawInspect"> |
| | | select id, code, name, specifications, unit, number, ins_state, judge_state, ins_time, user_name, create_time, |
| | | form_time |
| | | <select id="selCountRaw" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from mom_ocean.raw_inspect |
| | | where state = 1 |
| | | where state=1 |
| | | and ins_state=1 |
| | | and judge_state=#{judgeState} |
| | | <if test="begin != null and begin!=''"> |
| | | and raw_inspect.create_time >= #{begin} |
| | | </if> |
| | | <if test="end != null and end!=''"> |
| | | and raw_inspect.create_time <= #{end} |
| | | </if> |
| | | </select> |
| | | <select id="seAllCount" resultType="java.lang.Long"> |
| | | select count(id) |
| | | from mom_ocean.raw_inspect |
| | | where state=1 |
| | | <if test="begin != null and begin!=''"> |
| | | and raw_inspect.create_time >= #{begin} |
| | | </if> |
| | | <if test="end != null and end!=''"> |
| | | and raw_inspect.create_time <= #{end} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--分页查询原材料检验单列表--> |
| | | <select id="selectRawInspectsList" resultType="java.util.Map"> |
| | | select id, |
| | | DATE_FORMAT(form_time, '%Y-%m-%d') formTime, |
| | | code, |
| | | name, |
| | | specifications, |
| | | unit, |
| | | number, |
| | | DATE_FORMAT(create_time, '%Y-%m-%d') createTime, |
| | | user_name, |
| | | DATE_FORMAT(ins_time, '%Y-%m-%d') insTime, |
| | | ins_state, |
| | | judge_state |
| | | from mom_ocean.raw_inspect |
| | | where state=1 |
| | | <if test="formTime!=null and formTime!=''"> |
| | | and form_time = #{formTime} |
| | | and form_time=#{formTime} |
| | | </if> |
| | | <if test="createTime!=null and createTime!=''"> |
| | | and create_time = #{createTime} |
| | | <if test="code!=null and code!=''"> |
| | | and code like concat('%',#{code},'%') |
| | | </if> |
| | | <if test="insState!=2"> |
| | | and ins_state = #{insState} |
| | | <if test="insState!=null"> |
| | | and ins_state=#{insState} |
| | | </if> |
| | | <if test="judgeState!=2"> |
| | | and judge_state = #{judgeState} |
| | | <if test="name!=null and name!=''"> |
| | | and name like concat('%',#{name},'%') |
| | | </if> |
| | | order by id desc |
| | | limit #{pageSize},#{countSize} |
| | | </select> |
| | | |
| | | <!--根据原材料检验单id查看详情--> |
| | | <resultMap id="oneMap" type="map"> |
| | | <id property="rcode" column="rcode"/> |
| | | <result property="formTime" column="formTime"/> |
| | | <result property="rname" column="rname"/> |
| | | <result property="specifications" column="specifications"/> |
| | | <result property="runit" column="runit"/> |
| | | <result property="number" column="number"/> |
| | | <result property="supplier" column="supplier"/> |
| | | <result property="judgeState" column="judge_state"/> |
| | | <result property="userName" column="user_name"/> |
| | | <collection property="children" resultMap="twoMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="twoMap" type="map"> |
| | | <id property="rpId" column="rpId"/> |
| | | <result property="rpName" column="rpName"/> |
| | | <result property="rpUnit" column="rpUnit"/> |
| | | <result property="required" column="required"/> |
| | | <result property="internal" column="internal"/> |
| | | <result property="testValue" column="test_value"/> |
| | | <result property="testState" column="test_state"/> |
| | | <result property="devName" column="devName"/> |
| | | <result property="uName" column="uName"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectRawInspectsListById" resultMap="oneMap"> |
| | | select DATE_FORMAT(form_time, '%Y-%m-%d') formTime, |
| | | r.code rcode, |
| | | r.name rname, |
| | | specifications, |
| | | r.unit runit, |
| | | number, |
| | | supplier, |
| | | judge_state, |
| | | user_name, |
| | | rp.id rpId, |
| | | rp.name rpName, |
| | | rp.unit rpUnit, |
| | | required, |
| | | internal, |
| | | test_value, |
| | | test_state, |
| | | device.name devName, |
| | | user.name uName |
| | | from mom_ocean.raw_ins_product rp |
| | | left join mom_ocean.raw_inspect r on rp.raw_inspect_id = r.id |
| | | left join mom_ocean.device |
| | | on rp.device_id = device.id |
| | | left join mom_ocean.user on rp.user_id = user.id |
| | | where r.state = 1 |
| | | and rp.state = 1 |
| | | and r.id = #{id} |
| | | </select> |
| | | </mapper> |