**
1. sql if else if
**
SELECT
CASE contract_dc WHEN contract_dc <1 then ‘1’
when contract_dc>1 and contract_dc <2 then “2”
when contract_dc>=3 and contract_dc <4 then “4”
2. mysql 添加返回主键id
第一种
<insert id=“queryinsertAllcontre” useGeneratedKeys=“true” keyColumn=“id” keyProperty=“id”
第二种
< selectKey keyProperty=“id” order=“AFTER” resultType=“java.lang.Integer”>
SELECT LAST_INSERT_ID()
< /selectKey >
3. mybatis映射
映射集合
<collection property="mid" javaType="list" ofType="map">
</collection>