123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804 |
- <?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="cn.ourwill.module.house.dao.new_dao.RecordMedicineApproveBranchMainNewDao" >
- <resultMap type="cn.ourwill.module.house.entity.new_entity.RecordMedicineApproveBranchMainNew" id="baseMap" >
- <id column="id" property="id" />
- <result column="grain_id" property="grainId" />
- <result column="apply_date" property="applyDate" />
- <result column="approve_date" property="approveDate" />
- <result column="approve_number" property="approveNumber" />
- <result column="approve_statement" property="approveStatement" />
- <result column="chief" property="chief" />
- <result column="general_manager" property="generalManager" />
- <result column="grain_name" property="grainName" />
- <result column="history_number" property="historyNumber" />
- <result column="c_id" property="cId" />
- <result column="c_time" property="cTime" />
- <result column="u_id" property="uId" />
- <result column="u_time" property="uTime" />
- <result column="uuid" property="uuid" />
- <result column="lister" property="lister" />
- <result column="plan_in_number" property="planInNumber" />
- <result column="total_number" property="totalNumber" />
- <result column="unit_code1" property="unitCode1" />
- <result column="unit_code2" property="unitCode2" />
- <result column="vice_general_manager" property="viceGeneralManager" />
- <result column="medicine_name" property="medicineName" />
- <result column="medicine_id" property="medicineId" />
- <result column="adjust" property="adjust" />
- <result column="grain_dosage" property="grainDosage" />
- <result column="grain_num" property="grainNum" />
- <result column="grain_type" property="grainType" />
- <result column="grain_volume" property="grainVolume" />
- <result column="house_id" property="houseId" />
- <result column="house_name" property="houseName" />
- <result column="house_type" property="houseType" />
- <result column="is_accept" property="isAccept" />
- <result column="is_new" property="isNew" />
- <result column="main_id" property="mainId" />
- <result column="medicament_manufacturers" property="medicamentManufacturers" />
- <result column="space_dosage" property="spaceDosage" />
- <result column="space_volume" property="spaceVolume" />
- <result column="temperature_date" property="temperatureDate" />
- <result column="theory_dosage" property="theoryDosage" />
- <result column="worm_density" property="wormDensity" />
- <result column="worm_type" property="wormType" />
- </resultMap>
- <sql id="columns">
- a.`id`,
- a.`apply_date`,
- a.`approve_date`,
- a.`approve_number`,
- a.`approve_statement`,
- a.`c_id`,
- a.`c_time`,
- a.`chief`,
- a.`general_manager`,
- a.`grain_id`,
- a.`grain_name`,
- a.`history_number`,
- a.`lister`,
- a.`plan_in_number`,
- a.`total_number`,
- a.`u_id`,
- a.`u_time`,
- a.`unit_code1`,
- a.`unit_code2`,
- a.`uuid`,
- a.`vice_general_manager`,
- a.`medicine_name`,
- a.`medicine_id`,
- a.`adjust`,
- a.`grain_dosage`,
- a.`grain_num`,
- a.`grain_type`,
- a.`grain_volume`,
- a.`house_id`,
- a.`house_name`,
- a.`house_type`,
- a.`is_accept`,
- a.`is_new`,
- a.`main_id`,
- a.`medicament_manufacturers`,
- a.`space_dosage`,
- a.`space_volume`,
- a.`temperature_date`,
- a.`theory_dosage`,
- a.`worm_density`,
- a.`worm_type`
- </sql>
- <sql id="joinCols">
- </sql>
- <select id="getBygrainId" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM record_medicine_branch_new a
- <include refid="joinCols"/>
- WHERE a.uuid = #{UuId}
- </select>
- <select id="findByCondition" resultMap="baseMap">
- SELECT *
- FROM record_medicine_branch_new a
- where uuid = #{uuid}
- </select>
- <select id="findUuid" parameterType="java.lang.Long" resultType="java.lang.String">
- SELECT uuid
- FROM record_medicine_branch_new
- where id = #{id}
- </select>
- <delete id="deleteByuuid" parameterType="java.lang.String">
- delete
- FROM record_medicine_branch_new
- where uuid = #{uuid}
- </delete>
- <select id="findList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM record_medicine_branch_new a
- <include refid="joinCols"/>
- <where>
- <if test="id !=null">
- and a.id = #{id}
- </if>
- <if test="grainId !=null">
- and a.grain_id = #{grainId}
- </if>
- <if test="applyDate !=null">
- and a.apply_date = #{applyDate}
- </if>
- <if test="approveDate !=null">
- and a.approve_date = #{approveDate}
- </if>
- <if test="approveNumber !=null">
- and a.approve_number = #{approveNumber}
- </if>
- <if test="approveStatement !=null">
- and a.approve_statement = #{approveStatement}
- </if>
- <if test="chief !=null">
- and a.chief = #{chief}
- </if>
- <if test="generalManager !=null">
- and a.general_manager = #{generalManager}
- </if>
- <if test="grainName !=null">
- and a.grain_name = #{grainName}
- </if>
- <if test="historyNumber !=null">
- and a.history_number = #{historyNumber}
- </if>
- <if test="cId !=null">
- and a.c_id = #{cId}
- </if>
- <if test="cTime !=null">
- and a.c_time = #{cTime}
- </if>
- <if test="uId !=null">
- and a.u_id = #{uId}
- </if>
- <if test="uTime !=null">
- and a.u_time = #{uTime}
- </if>
- <if test="uuid !=null">
- and a.uuid = #{uuid}
- </if>
- <if test="lister !=null">
- and a.lister = #{lister}
- </if>
- <if test="planInNumber !=null">
- and a.plan_in_number = #{planInNumber}
- </if>
- <if test="totalNumber !=null">
- and a.total_number = #{totalNumber}
- </if>
- <if test="unitCode1 !=null">
- and a.unit_code1 = #{unitCode1}
- </if>
- <if test="unitCode2 !=null">
- and a.unit_code2 = #{unitCode2}
- </if>
- <if test="viceGeneralManager !=null">
- and a.vice_general_manager = #{viceGeneralManager}
- </if>
- <if test="medicineName !=null">
- and a.medicine_name = #{medicineName}
- </if>
- <if test="medicineId !=null">
- and a.medicine_id = #{medicineId}
- </if>
- <if test="adjust !=null">
- and a.adjust = #{adjust}
- </if>
- <if test="grainDosage !=null">
- and a.grain_dosage = #{grainDosage}
- </if>
- <if test="grainNum !=null">
- and a.grain_num = #{grainNum}
- </if>
- <if test="grainType !=null">
- and a.grain_type = #{grainType}
- </if>
- <if test="grainVolume !=null">
- and a.grain_volume = #{grainVolume}
- </if>
- <if test="houseId !=null">
- and a.house_id = #{houseId}
- </if>
- <if test="houseName !=null">
- and a.house_name = #{houseName}
- </if>
- <if test="houseType !=null">
- and a.house_type = #{houseType}
- </if>
- <if test="isAccept !=null">
- and a.is_accept = #{isAccept}
- </if>
- <if test="isNew !=null">
- and a.is_new = #{isNew}
- </if>
- <if test="mainId !=null">
- and a.main_id = #{mainId}
- </if>
- <if test="medicamentManufacturers !=null">
- and a.medicament_manufacturers = #{medicamentManufacturers}
- </if>
- <if test="spaceDosage !=null">
- and a.space_dosage = #{spaceDosage}
- </if>
- <if test="spaceVolume !=null">
- and a.space_volume = #{spaceVolume}
- </if>
- <if test="temperatureDate !=null">
- and a.temperature_date = #{temperatureDate}
- </if>
- <if test="theoryDosage !=null">
- and a.theory_dosage = #{theoryDosage}
- </if>
- <if test="wormDensity !=null">
- and a.worm_density = #{wormDensity}
- </if>
- <if test="wormType !=null">
- and a.worm_type = #{wormType}
- </if>
- </where>
- GROUP BY medicine_id,uuid
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <select id="findAllList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM record_medicine_branch_new a
- <include refid="joinCols"/>
- <where>
- <if test="id !=null">
- and a.id = #{id}
- </if>
- <if test="grainId !=null">
- and a.grain_id = #{grainId}
- </if>
- <if test="applyDate !=null">
- and a.apply_date = #{applyDate}
- </if>
- <if test="approveDate !=null">
- and a.approve_date = #{approveDate}
- </if>
- <if test="approveNumber !=null">
- and a.approve_number = #{approveNumber}
- </if>
- <if test="approveStatement !=null">
- and a.approve_statement = #{approveStatement}
- </if>
- <if test="chief !=null">
- and a.chief = #{chief}
- </if>
- <if test="generalManager !=null">
- and a.general_manager = #{generalManager}
- </if>
- <if test="grainName !=null">
- and a.grain_name = #{grainName}
- </if>
- <if test="historyNumber !=null">
- and a.history_number = #{historyNumber}
- </if>
- <if test="cId !=null">
- and a.c_id = #{cId}
- </if>
- <if test="cTime !=null">
- and a.c_time = #{cTime}
- </if>
- <if test="uId !=null">
- and a.u_id = #{uId}
- </if>
- <if test="uTime !=null">
- and a.u_time = #{uTime}
- </if>
- <if test="uuid !=null">
- and a.uuid = #{uuid}
- </if>
- <if test="lister !=null">
- and a.lister = #{lister}
- </if>
- <if test="planInNumber !=null">
- and a.plan_in_number = #{planInNumber}
- </if>
- <if test="totalNumber !=null">
- and a.total_number = #{totalNumber}
- </if>
- <if test="unitCode1 !=null">
- and a.unit_code1 = #{unitCode1}
- </if>
- <if test="unitCode2 !=null">
- and a.unit_code2 = #{unitCode2}
- </if>
- <if test="viceGeneralManager !=null">
- and a.vice_general_manager = #{viceGeneralManager}
- </if>
- <if test="medicineName !=null">
- and a.medicine_name = #{medicineName}
- </if>
- <if test="medicineId !=null">
- and a.medicine_id = #{medicineId}
- </if>
- <if test="adjust !=null">
- and a.adjust = #{adjust}
- </if>
- <if test="grainDosage !=null">
- and a.grain_dosage = #{grainDosage}
- </if>
- <if test="grainNum !=null">
- and a.grain_num = #{grainNum}
- </if>
- <if test="grainType !=null">
- and a.grain_type = #{grainType}
- </if>
- <if test="grainVolume !=null">
- and a.grain_volume = #{grainVolume}
- </if>
- <if test="houseId !=null">
- and a.house_id = #{houseId}
- </if>
- <if test="houseName !=null">
- and a.house_name = #{houseName}
- </if>
- <if test="houseType !=null">
- and a.house_type = #{houseType}
- </if>
- <if test="isAccept !=null">
- and a.is_accept = #{isAccept}
- </if>
- <if test="isNew !=null">
- and a.is_new = #{isNew}
- </if>
- <if test="mainId !=null">
- and a.main_id = #{mainId}
- </if>
- <if test="medicamentManufacturers !=null">
- and a.medicament_manufacturers = #{medicamentManufacturers}
- </if>
- <if test="spaceDosage !=null">
- and a.space_dosage = #{spaceDosage}
- </if>
- <if test="spaceVolume !=null">
- and a.space_volume = #{spaceVolume}
- </if>
- <if test="temperatureDate !=null">
- and a.temperature_date = #{temperatureDate}
- </if>
- <if test="theoryDosage !=null">
- and a.theory_dosage = #{theoryDosage}
- </if>
- <if test="wormDensity !=null">
- and a.worm_density = #{wormDensity}
- </if>
- <if test="wormType !=null">
- and a.worm_type = #{wormType}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
- parameterType="cn.ourwill.module.house.entity.new_entity.RecordMedicineApproveBranchMainNew">
- INSERT INTO record_medicine_branch_new
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <!--<if test=" id != null">
- id,
- </if>-->
- <if test="grainId !=null">
- grain_id,
- </if>
- <if test="applyDate !=null">
- apply_date,
- </if>
- <if test="approveDate !=null">
- approve_date,
- </if>
- <if test="approveNumber !=null">
- approve_number,
- </if>
- <if test="approveStatement !=null">
- approve_statement,
- </if>
- <if test="chief !=null">
- chief,
- </if>
- <if test="generalManager !=null">
- general_manager,
- </if>
- <if test="grainName !=null">
- grain_name,
- </if>
- <if test="historyNumber !=null">
- history_number,
- </if>
- <if test="cId !=null">
- c_id,
- </if>
- <if test="cTime !=null">
- c_time,
- </if>
- <if test="uId !=null">
- u_id,
- </if>
- <if test="uTime !=null">
- u_time,
- </if>
- <if test="uuid !=null">
- uuid,
- </if>
- <if test="lister !=null">
- lister,
- </if>
- <if test="planInNumber !=null">
- plan_in_number,
- </if>
- <if test="totalNumber !=null">
- total_number,
- </if>
- <if test="unitCode1 !=null">
- unit_code1,
- </if>
- <if test="unitCode2 !=null">
- unit_code2,
- </if>
- <if test="viceGeneralManager !=null">
- vice_general_manager,
- </if>
- <if test="medicineName !=null">
- medicine_name,
- </if>
- <if test="medicineId !=null">
- medicine_id,
- </if>
- <if test="adjust !=null">
- adjust,
- </if>
- <if test="grainDosage !=null">
- grain_dosage,
- </if>
- <if test="grainNum !=null">
- grain_num,
- </if>
- <if test="grainType !=null">
- grain_type,
- </if>
- <if test="grainVolume !=null">
- grain_volume,
- </if>
- <if test="houseId !=null">
- house_id,
- </if>
- <if test="houseName !=null">
- house_name,
- </if>
- <if test="houseType !=null">
- house_type,
- </if>
- <if test="isAccept !=null">
- is_accept,
- </if>
- <if test="isNew !=null">
- is_new,
- </if>
- <if test="mainId !=null">
- main_id ,
- </if>
- <if test="medicamentManufacturers !=null">
- medicament_manufacturers ,
- </if>
- <if test="spaceDosage !=null">
- space_dosage,
- </if>
- <if test="spaceVolume !=null">
- space_volume,
- </if>
- <if test="temperatureDate !=null">
- temperature_date,
- </if>
- <if test="theoryDosage !=null">
- theory_dosage,
- </if>
- <if test="wormDensity !=null">
- worm_density,
- </if>
- <if test="wormType !=null">
- worm_type
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <!--<if test=" id != null">
- #{id}, </if>-->
- <if test="grainId !=null">
- #{grainId},
- </if>
- <if test="applyDate !=null">
- #{applyDate},
- </if>
- <if test="approveDate !=null">
- #{approveDate},
- </if>
- <if test="approveNumber !=null">
- #{approveNumber},
- </if>
- <if test="approveStatement !=null">
- #{approveStatement},
- </if>
- <if test="chief !=null">
- #{chief},
- </if>
- <if test="generalManager !=null">
- #{generalManager},
- </if>
- <if test="grainName !=null">
- #{grainName},
- </if>
- <if test="historyNumber !=null">
- #{historyNumber},
- </if>
- <if test="cId !=null">
- #{cId},
- </if>
- <if test="cTime !=null">
- #{cTime},
- </if>
- <if test="uId !=null">
- #{uId},
- </if>
- <if test="uTime !=null">
- #{uTime},
- </if>
- <if test="uuid !=null">
- #{uuid},
- </if>
- <if test="lister !=null">
- #{lister},
- </if>
- <if test="planInNumber !=null">
- #{planInNumber},
- </if>
- <if test="totalNumber !=null">
- #{totalNumber},
- </if>
- <if test="unitCode1 !=null">
- #{unitCode1},
- </if>
- <if test="unitCode2 !=null">
- #{unitCode2},
- </if>
- <if test="viceGeneralManager !=null">
- #{viceGeneralManager},
- </if>
- <if test="medicineName !=null">
- #{medicineName},
- </if>
- <if test="medicineId !=null">
- #{medicineId},
- </if>
- <if test="adjust !=null">
- #{adjust},
- </if>
- <if test="grainDosage !=null">
- #{grainDosage},
- </if>
- <if test="grainNum !=null">
- #{grainNum},
- </if>
- <if test="grainType !=null">
- #{grainType},
- </if>
- <if test="grainVolume !=null">
- #{grainVolume},
- </if>
- <if test="houseId !=null">
- #{houseId},
- </if>
- <if test="houseName !=null">
- #{houseName},
- </if>
- <if test="houseType !=null">
- #{houseType},
- </if>
- <if test="isAccept !=null">
- #{isAccept},
- </if>
- <if test="isNew !=null">
- #{isNew},
- </if>
- <if test="mainId !=null">
- #{mainId},
- </if>
- <if test="medicamentManufacturers !=null">
- #{medicamentManufacturers},
- </if>
- <if test="spaceDosage !=null">
- #{spaceDosage},
- </if>
- <if test="spaceVolume !=null">
- #{spaceVolume},
- </if>
- <if test="temperatureDate !=null">
- #{temperatureDate},
- </if>
- <if test="theoryDosage !=null">
- #{theoryDosage},
- </if>
- <if test="wormDensity !=null">
- #{wormDensity},
- </if>
- <if test="wormType !=null">
- #{wormType}
- </if>
- </trim>
- </insert>
- <update id="update" parameterType="cn.ourwill.module.house.entity.new_entity.RecordMedicineApproveBranchMainNew">
- UPDATE record_medicine_branch_new <set>
- <if test="id != null">
- id= #{id} ,
- </if>
- <if test="grainId !=null">
- grain_id = #{grainId},
- </if>
- <if test="applyDate !=null">
- apply_date = #{applyDate},
- </if>
- <if test="approveDate !=null">
- approve_date = #{approveDate},
- </if>
- <if test="approveNumber !=null">
- approve_number = #{approveNumber},
- </if>
- <if test="approveStatement !=null">
- approve_statement = #{approveStatement},
- </if>
- <if test="chief !=null">
- chief = #{chief},
- </if>
- <if test="generalManager !=null">
- general_manager = #{generalManager},
- </if>
- <if test="grainName !=null">
- grain_name = #{grainName},
- </if>
- <if test="historyNumber !=null">
- history_number = #{historyNumber},
- </if>
- <if test="cId !=null">
- c_id = #{cId},
- </if>
- <if test="cTime !=null">
- c_time = #{cTime},
- </if>
- <if test="uId !=null">
- u_id = #{uId},
- </if>
- <if test="uTime !=null">
- u_time = #{uTime},
- </if>
- <if test="uuid !=null">
- uuid = #{uuid},
- </if>
- <if test="lister !=null">
- lister = #{lister},
- </if>
- <if test="planInNumber !=null">
- plan_in_number = #{planInNumber},
- </if>
- <if test="totalNumber !=null">
- total_number = #{totalNumber},
- </if>
- <if test="unitCode1 !=null">
- unit_code1 = #{unitCode1},
- </if>
- <if test="unitCode2 !=null">
- unit_code2 = #{unitCode2},
- </if>
- <if test="viceGeneralManager !=null">
- vice_general_manager = #{viceGeneralManager},
- </if>
- <if test="medicineName !=null">
- medicine_name = #{medicineName},
- </if>
- <if test="medicineId !=null">
- medicine_id = #{medicineId},
- </if>
- <if test="adjust !=null">
- adjust = #{adjust},
- </if>
- <if test="grainDosage !=null">
- grain_dosage = #{grainDosage},
- </if>
- <if test="grainNum !=null">
- grain_num = #{grainNum},
- </if>
- <if test="grainType !=null">
- grain_type = #{grainType},
- </if>
- <if test="grainVolume !=null">
- grain_volume = #{grainVolume},
- </if>
- <if test="houseId !=null">
- house_id = #{houseId},
- </if>
- <if test="houseName !=null">
- house_name = #{houseName},
- </if>
- <if test="houseType !=null">
- house_type = #{houseType},
- </if>
- <if test="isAccept !=null">
- is_accept = #{isAccept},
- </if>
- <if test="isNew !=null">
- is_new = #{isNew},
- </if>
- <if test="mainId !=null">
- main_id = #{mainId},
- </if>
- <if test="medicamentManufacturers !=null">
- medicament_manufacturers = #{medicamentManufacturers},
- </if>
- <if test="spaceDosage !=null">
- space_dosage = #{spaceDosage},
- </if>
- <if test="spaceVolume !=null">
- space_volume = #{spaceVolume},
- </if>
- <if test="temperatureDate !=null">
- temperature_date = #{temperatureDate},
- </if>
- <if test="theoryDosage !=null">
- theory_dosage = #{theoryDosage},
- </if>
- <if test="wormDensity !=null">
- worm_density = #{wormDensity},
- </if>
- <if test="wormType !=null">
- worm_type = #{wormType}
- </if>
- </set>
- WHERE id = #{id}
- </update>
- <delete id="deleteById" parameterType="java.lang.Long">
- DELETE FROM record_medicine_branch_new WHERE id = #{id}
- </delete>
- <delete id="deleteByIds" parameterType="java.util.List">
- DELETE FROM record_medicine_branch_new WHERE id IN
- <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </delete>
- </mapper>
|